Microservices Scaling Design Principles

Microservices can be scaled up to larger and multiple development teams by putting each micro service in its own code repository and ensuring that each micro service has a separate CD pipeline for an independent deployment schedule . We can create a meta-repo (a composite repository constructed from separate code repositories) to bring separate code repositories into a convenient and cohesive whole. Through a small refactor of our Terraform infrastructure code, we use it to easily create separate environments, or instances of our application, so that we can have a production environment for our customers that is separate from the environment we use for testing new code changes.


Independent Deployment:

We can control deployments to production by creating a workflow where developers must merge their code changes through one or more branches. These merge points are opportunities to review and test the code before it’s inflicted on our customers. We can configure our CD pipeline to automatically deploy to particular environments; for example, we discussed a strategy where when we push to the test branch of our code, it deploys to the test environment, and when we push to the production branch, it deploys to the production environment.


Scaling Strategies:

  • There are multiple ways we can scale up with micro services to meet the demands of a growing customer base:
  • Vertically scaling the cluster — We can increase the size of each VM in the cluster.
  • Horizontally scaling the cluster — We can increase the number of VMs that power our cluster.
  • Horizontally scaling a microservice — We can increase the number of instances (replicas) for microservices that need more CPU power or more throughput.
  • Elastically scaling the cluster — We can configure our cluster to automatically scale up and down the number of VMs that power it depending on the demand currently placed on it.
  • Elastically scaling a microservice — We can configure each microservice to automatically scale up and down its number of instances depending on the demand currently placed on it.
  • Scaling the database — Keeping to the rule “one database per microservice” is the key to scaling our database in the future. If we need extra performance from our database, we can scale it vertically or horizontally.

How to minimize the impact of Micro services Scaling.

  • We need to make sure that we use of reliable automated testing and deployments. We need to have a well architected pipeline.
  • Enabling branch protection to put a review and testing checkpoint in front of developers pushing changes to the production branch
  • Testing in the test environment before merging changes to production
  • Using Kubernetes’ rolling updates feature to safely roll out changes to microservices
  • Using blue-green deployments to more safely make risky changes and restructuring to our application and its infrastructure

Post a Comment

Previous Post Next Post