Module 18 / High availability and multi-region

Module 18 · lesson 6 of 7 · Read 9 min

Routing users globally

GeoDNS, anycast and CDNs.

Tiffin now has cells in Mumbai, the Middle East and Singapore. A customer in Dubai opens the app. The app knows one thing: api.tiffin.app. Something has to turn that name into the address of the closest healthy region, and keep doing it correctly when a region goes down.

That's this lesson: the three tools that steer users around the world, what each is good at, and how they fit together in front of Tiffin.

Start with DNS

When the app looks up api.tiffin.app, it asks a resolver, usually run by the mobile carrier, the home internet provider or a public service like 8.8.8.8. The resolver asks Tiffin's DNS provider, gets an IP address back, and caches it for as long as the record's TTL (time to live) says, say 60 seconds. Every other user of that resolver gets the cached answer until it expires.

Normal DNS gives everyone the same answer. That's the first thing to change.