20+ Questions. Master scalability, reliability, and distributed architectures with detailed design breakdowns.
Search All System DesignsKey Challenge: The "Fanout" mechanism. Tweets need to reach millions of followers instantly.
Core Mechanism: Generating unique 6-8 character keys for a long URL and redirecting requests.
Key Challenge: Low-latency streaming and massive bandwidth requirements.
CAP Theorem: A distributed data store can only guarantee **two** of the following three properties simultaneously:
Implication: Since P is unavoidable in a real-world distributed system, developers must choose between **C and A**. Choosing **CP** (e.g., traditional RDBMS, MongoDB) sacrifices availability during a partition. Choosing **AP** (e.g., Cassandra, DynamoDB) sacrifices immediate consistency for availability.
Load Balancing: Distributing incoming network traffic across a group of backend servers to maximize throughput, minimize latency, and prevent any single server from becoming a single point of failure (SPOF).
Algorithms:
Sharding: Horizontal partitioning of a large database into smaller, independent pieces (shards) across different database server instances. This is done when vertical scaling (larger CPU/RAM) is no longer viable.
Sharding Keys: The column used to determine which shard a row belongs to (also called the partition key):
Challenge: Choosing the wrong key leads to "hotspots" or difficult cross-shard joins.