A principle that states a distributed system can only guarantee two out of three: Consistency, Availability, and Partition Tolerance.
In distributed systems (like databases spread across multiple servers or regions), network issues can and do happen. CAP Theorem helps us understand the tradeoffs we must make when designing for reliability in these systems.
Use it to reason about how your system should behave during network failures.. do you favor data accuracy (Consistency) or always responding to users (Availability)?
You need to know
Consistency means all nodes see the same data at the same time - no stale reads.
Availability means every request gets a response, even if it might not have the latest data.
Partition Tolerance means the system continues to operate despite network partitions (communication breakdowns between parts of the system).
Like posts like this?
Every week, you'll get a new system design concept, broken down like this one.
Free subscribers also get a little bonus:
🎁 The System Design Interview Preparation Cheat Sheet
If you're into visuals, paid subscribers unlock:
→ My Excalidraw system design template – so you have somewhere to start
→ My Excalidraw component library – used in the diagram of this issue
No pressure though. Your support helps me keep writing, and I appreciate it more than you know ❤️