Consistency, Replication, and CAP
Don't worry if these words sound scary — we'll explain each one along the way. In this lesson we learn how to talk in an interview about a few basic ideas: replication (keeping copies of the same data in several places, so if one machine fails there's a backup), quorum (the number of copies that mus
System Design (planning how to build big software that serves many people) is like planning a city: roads, storage, traffic lights, and maintenance crews so the city keeps running smoothly even during rush hour, when everyone is out at the same time.
- Consistency and replication
- The core idea of this lesson: how we keep copies of data (replication), how many copies must agree (quorum), why copies sometimes update only after a moment (eventual consistency), which trade-off we pick during a network problem (CAP), and how we switch to a backup automatically when something fails (failover).
- Trade-off
- Trade-off — a conscious choice where you gain one thing and pay for it with another, like picking fast food over a home-cooked meal: you save time but lose some quality. In an interview you explain what you gained and what it cost.
- Operational metric
- An operational metric — a number that shows whether the decision really works when the system is live and serving real users (this is called production). For example: latency (how long it takes to get an answer), error rate (the share of requests that fail), queue lag (how many tasks are waiting in line), cache hit ratio (how often we found the answer in fast memory), and more.