Codele / System design
Consistency and its trade-offs
When data lives in two places and the link between them breaks, each copy has to choose: stay correct or keep answering.
- A partition is when parts of a system are alive but cannot talk to each other.
- Consistent means every answer is correct and up to date. Available means every request gets an answer.
- During a partition you must choose. Refuse requests to stay correct, or keep answering and risk a stale (out-of-date) answer.
- This is the CAP idea: during a partition you cannot have both consistency and availability.
- Choose by the cost of being wrong. Money needs correct answers; a like counter can be a little late.
Loading the playable lesson…