Horizontal Scaling vs Vertical Scaling
Horizontal Scaling: Creating multiple copy of the same application and
keeping in multiple servers. If one server goes down, then request can be
redirected to another server.
Vertical Scaling: Using single system and increasing capacity of the same
system. If this system goes down, then application does not work.
Microservices
Monolith Architecture: – Big Rock
Unrestricted
Microservices Architecture:
Functional Decomposition:
In Microservices architecture, we have to decompose applications into small
services and services should communicate each other using REST or RPC calls.
Each service will have their own DB
Search
REST/RPC
Reviews
User 1
REST/RPC
Unrestricted
Users
User2 REST/RPC
Payments
User n
REST/RPC
Shipping
REST/RPC
Notification
User 1 want to make call for reviews and after that users => call to Load Balancer
then it goes to Reviews Microservice and now after that call uses REST or RPC call
to communicate to users microservice.
How to Scale Microservice (Scale Cube)
Data
Partitioning
Functional
Decomposition
Unrestricted
Horizontal Scaling
We can scale microservice using:
1. Functional Decomposition
2. Horizontal Scaling
3. Data Partitioning
1. Functional Decomposition: Divide application into microservices.
2. Horizontal Scaling: Create multiple copy of servers which will have same
service copy.
3. Data Partitioning: Microservices can be divided into small microservices
again to handle data separately.
Search
Reviews
Users
User 1 Payments
Shipping
Notification
User n
Unrestricted