Horizontal and Vertical Scaling Flashcards
Define vertical scaling
Vertical scaling is to increase the capacity of the server when the load increases - but this will require a reboot.
Mention some disadvantages and limitations of vertical scaling:
- Often times vertical scaling can only occur during planned outages - limits how quickly you can react/response to changes by scaling up or down.
- Larger instances also carry a $ premium compared to smaller instances - bigger instance, more expensive
- Instance size is an upper cap on performance.
Mention some advantages and limitations of vertical scaling:
- No application modification is needed - Works for all applications, even monoliths (all code in one app)
Define horizontal scaling
Horizontal scaling is to add additional capacity when the load increases.
What is the main difference between vertical and horizontal scaling?
With horizontal scaling, instead of one running copy of an application, you can have multiple versions running on each server (normally with smaller compute)
What is the function of the load balancer in horizontal scaling? Is it required?
This requires a load balancer. When customers try to access an application, the load balancer ensures the servers get equal parts of the load.
What are sessions and why are they important in horizontal scaling?
Sessions define the state of your interaction.
With horizontal scaling you might be jumping from instances and therefore is important to track the state of your interaction.
What is required for horizontal scaling to work correctly?
It requires the application to support it or to have off-host sessions, meaning that the sessions are not saved or stored in the instance itself (stateless servers) - session data is saved somewhere else.
Is there any disruption when scaling up/down with horizontal scaling?
No.
Is there a limitation on how much you can scale with horizontal scaling?
No.
Mention some of the benefits of using horizontal scaling:
- No disruption when scaling up/down.
- No real limits when scaling.
- More granular.
- Pay less as you can use smaller instances to scale.