Lesson 11 of 17
7. Load Balancers, Reverse Proxies and API Gateways

7.10 How do you balance traffic across regions?

3 min read+10 XP

At the airport: A traveller in Mumbai and one in London both want "the airline". Each is sent to the nearest airport first; inside each airport, the queue manager takes over.

In the system: Global load balancing picks a region (or data centre) first; regular load balancers then pick a server inside it. Two common ways:

  • DNS-based (GeoDNS): the DNS answer depends on where the user is, and health checks remove a dead region (Chapter 4, section 4.6). Simple, but slowed by DNS caching.
  • Anycast: the same IP address is announced from many locations, and the internet's routing delivers each user to the nearest one. Large CDNs and some cloud global load balancers work this way (Chapter 26).

The hard part isn't routing; it's data. Sending a user to a second region only helps if that region has their data, which brings in replication and consistency (Chapters 14 and 16).

Memory code: "Pick the airport first, then the counter."