Multi-Region
One region is a single place that can fail, and a single distance from every user. A second region fixes both, and then asks new questions: who serves which user, what the second region needs to hold to take over, what happens when two regions change the same record, how a user is sent to the right place, and how quickly they are sent somewhere else when a region is lost. This module is about those questions.
You will work with one lab that holds three groups of users and up to three regions. In it you choose active-passive or active-active, fail a region, and read the latency, the spare capacity, the time to serve users again and the data not yet copied out. There is a sorting exercise, a focused quiz on write conflicts, a C# example of last-write-wins against a merge, and a module quiz.
The lessons
Section titled “The lessons”- Why go multi-region (16 min). The three reasons, latency, availability and data residency, what a region is, and what a second one costs.
- Active-passive and active-active (18 min). Who serves whom, and how many servers each region needs so that the loss of one region fits.
- Replication across regions and write conflicts (22 min). Replication lag as data at risk, the price of synchronous copies, last-write-wins, and merging with a CRDT.
- Global traffic routing: GeoDNS and anycast (18 min). How users are sent to a region, and how the check interval and the TTL add up to the time to move them.
- Regional failure and evacuation (20 min). What a lost region takes, in capacity, time and data, and how to rehearse it.
- 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 whether a second region is justified by latency, availability or residency, and which of them it does not serve.
- Choose between active-passive and active-active, and size each region so that the loss of any one of them fits.
- Compute the data at risk from the write rate and the lag, and the price of removing it with synchronous copies.
- Explain how last-write-wins loses a write, how a skewed clock changes which one, and how a CRDT, a home region or a single writer avoid it.
- Explain how GeoDNS and anycast send users to a region, and compute the time to serve users again after a failure from the check interval, the failures and the TTL.
All the numbers in the lab are illustrative. The round trips, the shares of users and the lag are settings to compare choices, not measurements of any cloud provider.
Built by GhaziAlibi.
© ShardCraft. All rights reserved.