Scalability and Elasticity
What is Auto-Scaling in SaaS?
What is auto-scaling?
Auto-scaling is a feature that adjusts a SaaS application’s resources up or down based on current usage. When there are more users, auto-scaling increases available resources – on the flip side, it decreases them during quiet periods. Kubernetes’ Horizontal Pod Autoscaler, for example, checks usage every 15 seconds by default.
How does SaaS auto-scaling work?
SaaS companies need auto-scaling because they often don’t know when traffic is going up or down. While it’s sometimes predictable (e.g., a product launch), sudden global events and unexpected spikes are where auto-scaling should be deployed.
What are the key benefits of auto-scaling for SaaS businesses and their customers?
Reasons to use auto-scaling in your SaaS business include:
- Performance: Use auto-scaling so that your site or app works optimally during busy periods; without it, you could encounter service disruptions.
- Availability: Auto-scaling supports the reachability of sites, products, and services as demand fluctuates, while a load balancer manages traffic distribution among auto-scaled servers.
- Cost Optimization: Use auto-scaling to scale up and down based on real-time usage – you risk needless expenses if you use an alternative method.
What metrics are typically used to trigger auto-scaling events?
Auto-scaling is triggered by cloud performance metrics, checked at intervals (every 15 seconds by default in Kubernetes), such as:
- CPU Utilization: The amount of CPU being used at any given time.
- Memory Usage: How much memory an app or website is using in real-time.
- Network Traffic: Data received and sent over the network.
- Request Latency: Response times to user requests; this partly depends on how many users are on the same server.
- Queue Length: Pending queue requests; auto-scaling up is triggered when this is higher.
What are the different types of auto-scaling policies, and when would you use each?
Different auto-scaling policies work in varying scenarios. Here’s a list of some common ones and when you should use them:
- Target Tracking: Moves resources based on a metric like average queue length; AWS strongly recommends it for EC2 Auto Scaling (AWS).
- Step Scaling: Scales within thresholds you set, in steps sized to the breach; use when target tracking is not enough.
- Scheduled Scaling: Scales based on scheduled times; use if you know daily or weekly traffic patterns.
| Policy Type | Key Characteristics | Best Use Cases |
|
Scaling Approach |
||
| Target Tracking | Adjusts resources based on specific metrics like average queue lengths | Most cases, per AWS’s EC2 Auto Scaling guide |
| Step Scaling | Scales resources within predefined thresholds set by the user | When target tracking is not enough |
| Scheduled Scaling | Scales resources at predetermined times | When daily or weekly traffic patterns are consistent |
|
Scalability Considerations |
||
| Flexibility | Target Tracking: Most adaptable | Scheduled Scaling: Least flexible |
What are some real-world examples of SaaS businesses successfully utilizing auto-scaling to meet fluctuating demand?
Examples of SaaS companies that use auto-scaling based on demand are:
- Shopify: Runs microservices on Google Kubernetes Engine, which Google says scales during traffic spikes such as Black Friday (Google Cloud).
- Slack: Autoscales its web app tier quickly when workers become saturated (Slack Engineering, 2020).
- Netflix: Auto-scaling parameters are set to manage traffic when more viewers are online (e.g., evenings, as a Netflix patent on predictive scaling filed in 2013 describes).
Conclusion
SaaS companies should use auto-scaling to manage resources during high and low activity. Amazon Web Services, Pepperdata, and Google Cloud are three tools with auto-scaling. Consider whether you need target tracking, step scaling, or scheduled scaling.