Patterns
35 items
35 items
Adding more machines to handle increased load
Horizontal scaling (scaling out) adds more machines to handle increased load, as opposed to vertical scaling (scaling up) which upgrades a single machine. Adding servers multiplies capacity: 10 servers handle 10x the load of one server. This pattern enables theoretically unlimited scaling and eliminates single points of failure. However, it requires stateless application design, distributed data management, and load balancing. Horizontal scaling is how modern systems handle millions of users - Netflix runs thousands of instances, Google has millions of servers. The key insight is designing for horizontal scaling from the start is much easier than retrofitting later.
Adding servers increases capacity proportionally. 10 servers = 10x capacity. Unlike vertical scaling which has diminishing returns and hard limits, horizontal scaling can grow indefinitely.
For horizontal scaling, any server must handle any request. This requires stateless design - no local session state. Store state in external systems (Redis, database).
Cloud platforms enable auto-scaling based on metrics (CPU, request rate). Scale out during peak, scale in during quiet periods. Pay only for what you use.
Vertical Scaling (Scale Up): - Upgrade to bigger machine - More CPU, RAM, faster disk - Simple - no architecture changes - Has hard limits (biggest available machine) - Single point of failure
Horizontal Scaling (Scale Out): - Add more machines - Distribute load across fleet - Requires distributed architecture - No theoretical limit - Built-in redundancy