- Known growth curve: For example, in the case of an order management system, we need to know how many orders are supported by the current services and how they are proportionate to the order fulfillment service metric (measured in requests per seconds). The currently measured metrics are called baseline figures.
- Well-studied usage metrics: The traffic pattern generally reveals customer demand, and based on customer demand, many parameters mentioned in the previous sections regarding microservices can be calculated. Hence, microservices are instrumented, and monitoring tools are the necessary companions of microservices.
- Effective use of infrastructure resources: Based on qualitative and quantitative parameters, the anticipation of resource utilization can be done. This will help the team predict the cost of infrastructure and plan for it.
- Ability to measure, monitor, and increase the capacity using an automated infrastructure: Based on the operational and growth pattern of the resource consumption of microservices, it is very easy to plan for future capacity. Nowadays, with cloud elasticity, it is even more important to be able to plan and automate capacity. Essentially, cloud-based architecture is cost-driven architecture.
- Known bottlenecks: Resource requirements include the specific resources (compute, memory, storage, and I/O) that each microservice needs. Identifying these are essential for a smoother operational and scalable service. If we identify resource bottlenecks, they can be worked on and eliminated.
- Has dependency scaling in the same ratio: This is self-explanatory. However, you cannot just focus on a microservice, leaving its dependencies as bottlenecks. A microservice is as scalable as its least scaling dependency.
- Fault tolerant and highly available: Failure is inevitable in distributed systems. If you encounter a microservice instance failure, it should be automatically rerouted to a healthy instance of the microservice. Just putting load balancers in front of microservice clusters won't be sufficient in this case. Service discovery tools are quite helpful for satisfying this characteristic of scalable microservices.
- Has a scalable data persistence mechanism: Individual data store choices and design should be scalable and fault-tolerant for scalable microservices. Caching and separating out read and write storage will help in this case.
Now, while we are discussing microservices and scalability, the natural arrangement of scaling comes into the picture, which is nothing but the following:
- Scaling the infrastructure: Microservices operate well over dynamic and software-defined infrastructure. So, scaling the infrastructure is an essential component of scaling microservices.
- Scaling around service design: Microservice design comprises of an HTTP-based API as well as a data store in which the local state for the services is stored.