Imagine a busy restaurant that adds more tables to serve more customers at the same time. How does this relate to horizontal scaling in system design?
Think about adding more workers versus making one worker stronger.
Horizontal scaling means adding more servers (like adding tables) to handle more users at once. This spreads the load and improves capacity.
In a system designed to handle growing traffic, which component ensures that incoming requests are shared fairly among multiple servers?
Think about a traffic cop directing cars to different lanes.
A load balancer distributes incoming requests evenly across servers to prevent any single server from becoming overwhelmed.
Vertical scaling means upgrading a single server's resources. What is a main limitation or tradeoff of this approach?
Think about how much you can upgrade one computer before it stops improving.
Vertical scaling improves a single server's power but is limited by hardware capacity and cost, unlike horizontal scaling which adds more servers.
If each server can handle 1,000 requests per second, how many servers are needed to handle 10,000 requests per second assuming even load distribution?
Divide total requests by requests per server.
To handle 10,000 requests per second with each server handling 1,000, you need 10 servers (10,000 รท 1,000 = 10).
When adding many servers to handle growing traffic, what is a common challenge that can affect system performance?
Think about how multiple workers keep their work aligned.
Horizontal scaling adds complexity in keeping data consistent and synchronized across many servers, which can impact performance and reliability.