Microservice and Containerization Patterns > Scalability Patterns > Dynamic Scalability
Home > Design Patterns > Dynamic Scalability
Dynamic Scalability (Erl, Naserpour)
How can microservices be scaled automatically in response to fluctuating demand?
It is challenging to equip a microservice to match its processing requirements. If the demand for the microservice is below its capacity, then it is under-utilized and if the demand is above its capacity it is over-utilized or unable to meet the demand.
The microservice can be integrated with a reactive architecture capable of automatically scaling it horizontally or vertically in response to fluctuating demand.
Dynamic horizontal scaling can be enabled via the use of pools of identical microservices and components capable of dispersing and retracting workloads across each pool. Dynamic vertical scaling can be enabled via technology capable of swapping microservices or components at runtime.
A system of predefined scaling conditions that trigger the dynamic allocation of IT resources can be introduced. The microservice resources are allocated from resource pools to allow for variable utilization as dictated by demand fluctuations. Unneeded IT resources are efficiently reclaimed without requiring manual interaction.
This pattern can be applied using an automated scaling listener in support of dynamic horizontal scaling, dynamic vertical scaling and dynamic relocation, as explained in the complete pattern description.