Phase 11: Capacity Estimation & Trade-offs
Explore the concepts of Capacity Estimation & Trade-offs.
Back-of-the-Envelope Calculations
Back-of-the-envelope calculations are rough estimates used to determine the scale of a system before you design it. By approximating traffic, storage, and bandwidth, you can make informed decisions about database choices, caching strategies, and network architecture. 🧠 Mental model: Think of it as sizing up a party. If you expect 10 guests, you buy a few pizzas. If you expect 10,000 guests, you need catering trucks, porta-potties, and crowd control. You don't need to know exactly how many slices each person will eat, just the order of magnitude.
Storage Estimation
Storage estimation is the process of calculating how much disk space your system will require over a given time frame (usually 1 to 5 years). This dictates what kind of database you use, whether you need sharding, and how you handle data archiving. 🧠 Mental model: If you are building a library, you need to know how many new books arrive every day and how thick they are. Multiply that by 5 years, and you know how many bookshelves you need to buy and how big the building must be.
QPS/Bandwidth Estimation
Queries Per Second (QPS) and Bandwidth estimations determine the network and compute capacity your system requires. QPS dictates how many load balancers, app servers, and database connections you need. Bandwidth dictates your network costs and whether you require a Content Delivery Network (CDN). 🧠 Mental model: QPS is the number of cars passing through a tollbooth every second (compute load). Bandwidth is the combined weight of the cargo in those cars (network load). A million motorcycles (high QPS, low bandwidth) stress the system differently than ten massive freight trucks (low QPS, high bandwidth).
Trade-off Analysis
Trade-off analysis is the core of system design. There is no "perfect" architecture, only the right compromises for a specific set of requirements. Every architectural decision improves one aspect of the system while degrading another (e.g., consistency vs. availability, latency vs. throughput, speed of development vs. operational complexity). 🧠 Mental model: Think of it as a video game character creation screen where you have a limited number of stat points. If you put all your points into Speed (Latency), you have to take points out of Armor (Consistency) or Health (Reliability). You can't have 100 in every stat.