Microservices from the Perspective of the Scaling Cube
Let's examine microservices through the concept of the Scaling Cube.
The Scaling Cube defines three ways to scale an application.
- X-axis scaling load balances incoming requests across identical multiple instances.
- Z-axis scaling routes requests based on their attributes.
- Y-axis scaling decomposes the application into services based on functionality.
X-axis Scaling: Evenly Distributing Requests Across Multiple Instances #
X-axis scaling is a common method for scaling monolithic applications.
N application instances are run behind a load balancer, which evenly distributes incoming requests to these instances.
It is used to improve application capacity and availability.

Z-axis Scaling: Routing by Request Attributes #
Running multiple instances of a monolithic application is similar to X-axis scaling, but with Z-axis scaling, each instance is configured to handle only a given subset of data.
A router routes requests to the appropriate instance based on the request's attributes.
Each application instance processes only the subset of users assigned to it.
The router selects one of N identical application instances based on the userId contained in the Authorization request header.
Z-axis scaling is an effective means to scale applications to handle increasing transaction and data volumes.

Y-axis Scaling: Decomposing Applications into Services by Functionality #
While X-axis and Z-axis scaling improve application capacity and availability, the application becomes increasingly complex. Therefore, it is decided to break it down into multiple services.
A service is a mini-application that implements specific functionalities, such as order management or customer management, and X-axis/Y-axis scaling is also possible depending on the service.
For example, an order service can be configured to load balance across multiple service instances.
