# Multi-region architecture

> Running an application in several cloud regions so it survives losing a whole one.

- Level: Advanced
- Topics: Cloud
- URL: https://tidbit.legios.com.ar/multi-region-architecture/
- In Spanish: [Arquitectura multirregión](https://tidbit.legios.com.ar/es/multi-region-architecture/)

A cloud region is a group of data centers in one geographic area, like Northern Virginia or São Paulo. Spreading an app across availability zones inside one region already protects it from losing a single building. A **multi-region architecture** goes further: it runs the application in two or more regions, often far apart, so it keeps working even if an entire region fails, and so users far away get answers from a closer place.

There are two main styles. In active-passive, one region serves all the traffic and another keeps a copy ready to take over; DNS or a global load balancer moves users when the main one fails. In active-active, every region serves users at the same time. Active-active is faster for a global audience and fails over more smoothly, but it is much harder to build.

The hard part is the data. Copying a database between regions takes time, because distance adds latency, so at any moment the copies can be slightly behind. Two users editing the same record in different regions can conflict. Teams must choose between waiting for every region to agree, which is slow, or accepting a small window of changes that could be lost or reconciled later. On top of that you pay for servers and data transfer in every region, and some laws limit where personal data can go. That is why many companies keep multi-region for their most critical systems.

## An analogy

Like a company with offices in two cities: if a storm closes one, the other keeps serving customers. But every important file has to stay in sync between them, and that is where most of the work goes.

## Keep in mind

- The app runs in two or more regions, far apart.
- It survives a full region outage and serves distant users faster.
- Active-passive keeps a standby; active-active serves from every region.
- Keeping data in sync across regions is the hardest and costliest part.

## Go deeper

- [Disaster recovery options in the cloud (AWS whitepaper)](https://docs.aws.amazon.com/whitepapers/latest/disaster-recovery-workloads-on-aws/disaster-recovery-options-in-the-cloud.html)
- [Designing for redundancy (Azure Well-Architected Framework)](https://learn.microsoft.com/en-us/azure/well-architected/reliability/redundancy)
- [Geography and regions (Google Cloud docs)](https://docs.cloud.google.com/docs/geography-and-regions)

## Related terms

- [Cloud computing](https://tidbit.legios.com.ar/cloud-computing/): Renting computers over the internet instead of buying your own.
- [Regions and Availability Zones](https://tidbit.legios.com.ar/regions-and-availability-zones/): Where AWS physically lives: cities worldwide, each split into separate data centers.
- [Data center](https://tidbit.legios.com.ar/data-center/): A building full of servers where the internet, the cloud and AI actually run.
- [DNS](https://tidbit.legios.com.ar/dns/): The internet's phone book: it turns names like wikipedia.org into IP addresses.
- [Load balancer](https://tidbit.legios.com.ar/load-balancer/): The traffic cop that spreads incoming requests across many servers.
- [Database](https://tidbit.legios.com.ar/database/): An organized store of data that programs can search and update safely.
- [Bandwidth and latency](https://tidbit.legios.com.ar/bandwidth-and-latency/): How much data fits per second, and how long each trip takes. Two different things.
- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
