System Design · Fundamentals · Topic 2 of 4
CAP, Consistency & Availability
4 questions.
Your progress0%
- 1st Visit
- 0/4
- 2nd Visit
- 0/4
- Revise
- 0/4
Overview
When data is replicated across machines, a system must decide what a read returns while replicas disagree and what to do when the network between them fails. This topic covers the CAP theorem, the spectrum from strong to eventual consistency, quorum-based replication, and how availability is measured and promised through SLAs. These ideas appear whenever a design stores data on more than one node, which is nearly every design at scale. Signals in a problem include phrases such as globally distributed, must never show stale data, or must stay up during outages. Strong answers tie the choice to the business need: bank balances favour consistency, while like counts and feeds tolerate staleness.
Questions
| # | Problem | Platform | Difficulty | Open | 1st1st Visit | 2nd2nd Visit | RevRevise |
|---|---|---|---|---|---|---|---|
| 1 | What is the CAP theorem? | Concept | Easy | Read the answer to What is the CAP theorem? | |||
| 2 | What is the difference between strong consistency and eventual consistency? | Concept | Medium | Read the answer to What is the difference between strong consistency and eventual consistency? | |||
| 3 | How is availability measured, and what do SLAs, SLOs and the 'nines' mean? | Concept | Medium | Read the answer to How is availability measured, and what do SLAs, SLOs and the 'nines' mean? | |||
| 4 | How do quorum reads and writes work, and why does R + W > N matter? | Concept | Hard | Read the answer to How do quorum reads and writes work, and why does R + W > N matter? |