System Design Visualized
Lesson 1.9

Multiple data centers

Play this lessonThis lesson comes with an interactive animation you can break and a chapter quiz.

As your site gets popular internationally, you add more data centers for better availability and speed. Users are geoDNS-routed (geo-routed) to the closest one: geoDNS resolves the domain to different IPs depending on where the user is. Traffic is split, say x% to US-East and (100 − x)% to US-West.

If a whole data center goes down, all traffic is sent to a healthy one.

Technical challenges

  • Traffic redirection: tools like GeoDNS send users to the nearest healthy data center.
  • Data synchronization: users in different regions may use different local databases or caches. During a failover, traffic can land where the data isn't. The usual fix is to replicate data across data centers (Netflix does asynchronous multi-data-center replication).
  • Test and deployment: test the app in every location, and use automated deployment tools to keep services consistent everywhere.

Key takeaways

  • geoDNS routes users to the closest data center.
  • On an outage, 100% of traffic goes to the healthy data center.
  • Hard parts: redirection, data sync, deployment.

Remember it, then prove it

Create a free account to save your progress, get spaced-repetition reviews of what you miss, and design real systems in the interview simulator.

Start free