Data and Distributed Systems · 18 min · free with an account

CAP in Practice

Lesson preview · about 30%

CAP is about what happens during a partition, not a menu of three.

Core idea

Partitions are not optional; C versus A is what you choose when one happens.

Start with the idea

When the network splits you either refuse writes to stay consistent, or accept them and diverge. Everything else — quorums, leader election, eventual consistency, CRDTs — is a way of choosing where on that line to sit. Saying pick two is the answer that gets followed up; saying what your system does during a partition is the one that lands.

The CAP result is about what a distributed system can guarantee when a network partition separates participants. If it keeps accepting operations on both sides, it cannot also guarantee a single immediately consistent view of those operations. If it preserves a strong consistency contract, some requests may have to wait or fail until communication is restored. This is a narrower and more useful statement than treating consistency, availability, and partition tolerance as three features you choose on a normal day.

Describe a two-region account service during a partition.

Keep learning, for free

The rest of this lesson is waiting for you.

Create a free account to read the complete explanation, see the infographic, explore the code, and try the exercises. All 742 lessons and algorithm steps are included.

No payment details. Your account opens the complete Academy.

← All lessons in Rust Interview Prep