<aside>
💡 Generated by BigBrain. Repeated material was merged while distinct trade-offs, caveats, examples, and operational details were retained.
</aside>
01 - Foundations and Design Method
This reference page consolidates foundational principles, design methods, and operational insights for system design. It covers system-design principles, interview methods, requirement discovery, capacity estimation, reusable templates, decision frameworks, and general design heuristics. The material is organized from fundamentals to design choices and operational concerns.
System Design Fundamentals
Scalability
Scalability refers to a system's ability to handle increased workload cost-effectively. It involves adding resources (e.g., servers, databases) to maintain performance as demand grows. However, scalability is not infinite; at some point, adding resources becomes inefficient.
- Horizontal Scaling: Adding more machines (e.g., web servers, database replicas).
- Vertical Scaling: Increasing the capacity of a single machine (e.g., upgrading CPU, RAM).
- Trade-offs: Horizontal scaling improves fault tolerance but adds complexity (e.g., load balancing, data partitioning). Vertical scaling is simpler but limited by hardware constraints.
Latency and Throughput
- Latency: The time taken for a system to respond to a request (e.g., 10 ms for a database query).
- Throughput: The number of requests a system can handle per unit time (e.g., 10,000 requests/sec).
- Trade-offs: Optimizing for one often impacts the other. For example, batching requests improves throughput but increases latency.
Availability and Consistency
- Availability: The system's ability to remain operational (measured in "nines," e.g., 99.99% uptime allows ~52 minutes of downtime per year).
- Consistency: Ensures all users see the same data at the same time.
- CAP Theorem: In distributed systems, you can only achieve two of Consistency, Availability, and Partition Tolerance simultaneously.
- CP Systems: Prioritize consistency and partition tolerance (e.g., financial systems).
- AP Systems: Prioritize availability and partition tolerance (e.g., social media feeds).