What is Multi-region?
Multi-region, told as a story about building a twin park in another city.
One city floods, and the whole park shuts its doors.Guests everywhere can't get in.
If the park exists in only one city, trouble there means it's over.With only one, there's nowhere else to go.
Build a twin park in another city.When one has trouble, guests get sent to the other.
When one city stops, the other takes the guests.The log was already replicated, so guests can be redirected right away.
Building and keeping up both costs twice as much.So only the services that truly need it get multi-region.
Multi-region = building a twin park in another city and keeping their logs replicated to each other, so that when one city has trouble, guests get redirected to the other. The cost of running both, though, is double.
A strategy of running the same service in geographically separate regions (data centers) too. Replication keeps data in sync across regions, and failover switches to another region when one has trouble. More distant regions mean more latency, and data sovereignty — which country the data may sit in — has to be considered too.
When grown-ups say it
- Multi-region
- Keeping twin parks in more than one city. If one city stops, there's always another.
- Active-active
- A setup where both cities take guests all along. Since both are already working, losing one is no big deal.
- Active-passive
- A setup where only one city takes guests normally. The twin city just waits, idle, most of the time.
- Latency
- How long it takes to go back and forth, the farther the city. A distant city is slower than a nearby one.
- Data sovereignty
- The question of which country a guest log is allowed to sit in. Choosing a city (region) also means checking the law there.
- Disaster recovery
- The plan for reopening even if one whole park collapses. Multi-region is a classic way to achieve disaster recovery. → how to open the morning after the fire
- Replication
- Keeping both cities' guest logs identical. If replication lags, the city you switch to may have a slightly older log.
- Failover
- The act of switching to the other city when one stops. Multi-region is failover scaled up to a whole city. → when the generator dies, the spare takes over