Skip to content

Multi-region: recap and quiz

  1. Why go multi-region. A second region buys lower latency for users who are far from the first, survival of a regional failure, and a place to keep data that may not leave an area, and it costs idle capacity, data in two places, routing, and a failure path used rarely.
  2. Active-passive and active-active. In active-passive one region serves and another waits; in active-active every region serves its nearest users, and each must hold the load of a lost neighbour, so the peak over N − 1 is the least and nearest-region routing needs more.
  3. Replication and conflicts. The lag between regions is the data at risk when one fails, synchronous copies remove it for the price of a round trip, and two writing regions can overwrite each other, which last-write-wins does silently and a merge or a single writer avoids.
  4. Global traffic routing. GeoDNS decides at lookup time and sees the resolver, anycast decides at every packet, and with DNS the time to move users is the check interval times the failures plus the wait for cached answers.
  5. Regional failure and evacuation. A lost region takes capacity, time and recent writes, the regions left must be able to carry everything, and the failover has to be rehearsed and independent of the region that failed.
Idea What breaks What you see What helps
Reasons A second region for latency when users are in one place Cost with no gain Name the reason; check where the users are
Layout Regions sized for normal traffic only A region lost, another overloaded, requests refused Size every region for the worst single loss, with a margin
Replication A failed region holds writes no one else has Lost recent writes, or write conflicts A smaller lag, synchronous copies, a single writer or a merge rule
Routing A long TTL, or a check too slow or too eager Minutes of errors, or a failover on a false alarm Several checkers, a TTL chosen for the failover time, anycast
Failure A failover that was never tested A plan that fails when needed Rehearse it; keep it off the failed region’s control plane

Each question points back to the lesson that answers it.

  1. Which reason do you have: latency, availability or residency? If it is latency, where are the users? (Why go multi-region)
  2. Does one region serve everyone, or does each serve its own users? (Active-passive and active-active)
  3. If any one region is lost, can the others carry everything? Compute the busiest region left, not the average. (Active-passive and active-active)
  4. How much recent data can you afford to lose, and what does a smaller lag or a synchronous copy cost? (Replication and conflicts)
  5. Can two regions write the same record, and what is the rule if they do? Last-write-wins, a merge, or one home region per record. (Replication and conflicts)
  6. How are users sent to a region, and what does that see: the user or the resolver? (Global traffic routing)
  7. How long are users stranded: the check interval times the failures, plus the TTL? (Global traffic routing)
  8. What triggers a failover, a person or a check, and what does a false alarm cost? (Global traffic routing)
  9. When did you last lose a region on purpose? (Regional failure and evacuation)

Ten questions cover the whole module. Every option is explained, whether it is right or wrong.

Multi-region: module quiz

This quiz needs JavaScript to check your answers.

Question 1 of 10

60% of a service’s users are 10 ms from region A. The other 40% are 120 ms from A and 15 ms from region B.

What is the mean round trip with region A only?

Enter a number and choose its unit.

ms
Question 2 of 10

All of a service’s users are in one city, and a cloud region is available in that country.

Which of the three reasons for a second region is gone?

Choose one answer.

Question 3 of 10

Four regions serve a peak of 2,400 requests a second, and the load can be spread perfectly evenly over any regions that are left.

How many requests a second must each region be able to serve so that the loss of any one region fits?

Enter a number and choose its unit.

requests a second
Question 4 of 10

A team runs an active-passive pair. The primary serves the whole peak of 1,200 requests a second with 12 servers. The standby has 4 servers to save money and is promoted when the primary fails.

What happens when the primary fails?

Choose one answer.

Question 5 of 10

A health check runs every 5 seconds and traffic moves after 3 failed checks in a row. The DNS answer has a TTL of 40 seconds, and the time left on cached answers is spread evenly from zero to the TTL.

After how many seconds, on average, is a client served by another region again?

Enter a number and choose its unit.

s
Question 6 of 10

A region accepts 300 requests a second, and 20% of them are writes. Its data is copied to another region asynchronously, with a lag of 5 seconds. The region fails.

About how many writes had not yet been copied out of it?

Enter a number and choose its unit.

writes
Question 7 of 10

A user in Asia-Pacific has configured a public DNS resolver that runs in North America. The service uses GeoDNS and the resolver does not send the user’s subnet.

Which region is the user likely to be sent to?

Choose one answer.

Question 8 of 10

Two regions accept writes to the same record, and the system keeps the write with the later timestamp. One region’s clock is behind by more than the gap between the writes.

What can go wrong?

Choose one answer.

Question 9 of 10

A G-counter has one slot for each of two regions. Region A holds the state [3, 1] and region B holds [2, 4]. They exchange their states and merge them by taking the larger value of each slot.

What value does the counter show after the merge?

Enter a number and choose its unit.

count
Question 10 of 10

A team’s runbook for a regional failure begins: sign in to the console of the region that is failing, and change the traffic settings there.

What is wrong with this plan?

Choose one answer.

A service that survives the loss of a region still has to say what it promises its callers and how it talks to them. The next module looks at how services communicate, over requests and responses, streams and callbacks, and the later ones at limiting traffic, seeing what a system is doing, and securing it. Ask this module’s questions about any of them: what happens when a region is gone, and what do the callers see?

Your progress

Built by GhaziAlibi.

© ShardCraft. All rights reserved.