Coder Social home page Coder Social logo

refarch-cloudnative-resiliency's Introduction

Making Microservices Resilient

Introduction

This is a repository contains instructions for making the [reference applicaiotn] (https://github.com/ibm-cloud-architecture/refarch-cloudnative) Resilient. It will cover topics on making this implementation Highly Available, able to failover, and how to handle disaster recovery.

The Diagram below shows the topology for scaling the solution in Bluemix.

Architecture

Much of the guidance comes from this article.

Adding Load Balancing into the Solution

This section describes how to configure a Global Load Balancer for across 2 Bluemix Instances. We will aim to provide several examples.

Using nginx as a Global Load Balancer

HA and Failover Built into the Bluemix Platform

Container Groups

The Bluemix Platform has built in clustering for Containers.

In our example, we created Container Groups:

  • The Inventry Microservice runs in a Docker Containter.

The command below shows how we create a Container Group, which provides multiple container instances. You can use the tutorial In Step 7, we created the container using a Container Group that creates Docker Cluster to execute.

 cf ic group create -p 8080 -m 512 --min 1 --auto --name micro-inventory-group -e "spring.datasource.url=jdbc:mysql://{ipaddr-db-container}:3306/inventorydb" -e "spring.datasource.username={dbuser}" -e "spring.datasource.password={password}" -n inventoryservice -d mybluemix.net registry.ng.bluemix.net/$(cf ic namespace get)/inventoryservice:cloudnative


cf ic group create -p 8080 -m 512 --min 1 --auto --name micro-socialreview-group -n socialreviewservice -d mybluemix.net registry.ng.bluemix.net/{yournamespace}/socialreviewservice

You can learn about Container Groups here.

It is important that any container that needs to store data, should use volumes as described here.

AutoScale

For our Node.JS based Cloud Foundry Applications, we use AutoScaling built into the platform. Both Services use this.

 cf create-service Auto-Scaling free cloudnative-autoscale

Replicating Databases

How you replicate databases across Cloud Instances is key to providing DR. We have 2 examples for our reference implementation.

refarch-cloudnative-resiliency's People

Contributors

jkwong888 avatar ssibm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.