Replication
Keeping a copy of the data on another machine protects against losing the machine, and lets you answer more reads. The cost is that the copy is a little behind, that choosing who is in charge when something fails is hard, and that some choices lose writes that clients were told were safe. This module is about both halves: what replication buys, and what happens when it is tested.
You will work with a replication simulator that you can break in four ways, and two failure labs, and every lesson has a moment where you change one setting and see what is lost.
The lessons
Section titled “The lessons”- Single-leader replication: one primary, several replicas (18 min). What a primary and a replica do, what replicas buy and what they do not, and an overview of multi-leader and leaderless designs.
- Synchronous and asynchronous replication (16 min). When the primary says a write is done, and what each answer costs in waiting and in safety.
- Replication lag and stale reads (24 min). Stale reads, read-your-writes and monotonic reads, and a failure lab where the lag grows.
- Failover and lost writes (24 min). What happens when the primary dies, and a failure lab where you kill it.
- Split brain and fencing (20 min). Two primaries, and how to stop one of them.
- Recap and quiz (12 min). The module in one page, a design checklist, and a quiz.
What you will be able to do
Section titled “What you will be able to do”- Say what a write has been promised when the client is told it succeeded, and what that costs.
- Match a stale-read symptom to the guarantee that removes it.
- Work out which acknowledged writes a failover loses, and which settings change that.
- Explain how a partition produces two primaries, and what fencing does about it.
All the numbers in the labs are illustrative. They are for comparing choices, not for forecasting any real product.
Built by GhaziAlibi.
© ShardCraft. All rights reserved.