TwiceToldby Develoker
ConceptsSystem designLabsCheat sheetsAbout

Develoker makes free tools for learning to build software. TwiceTold explains each idea twice, as an everyday analogy and the real thing; CloudArch lets you design cloud systems and put load on them.

About ยท Labs ยท Cheat sheets ยท Learning paths

โ† Back to Amazon Route 53

๐Ÿชง Amazon Route 53: cheat sheet

๐ŸŽจ The analogyThe city information kiosk that tells visitors which branch of your shop to go to, following your rules.
๐ŸŽ“ The regular explanationAWS's authoritative DNS service. Hosted zones hold your records, alias records point names (even the bare domain) at AWS resources, routing policies choose which answer each query gets, and health checks take failed endpoints out of the answers.
Route 53 answers for your domainStep 4 of 4
Bloom's binderNSkey example.com NS (4 name servers): NS0SOAkey example.com SOA: SOA1A wkey www.example.com A 203.0.113.10: A www23๐ŸงณMia๐Ÿ›Ž๏ธHotel front deskkept on a note๐Ÿ›๏ธCity name register๐ŸชงInformation kioskone of 4 kiosks๐Ÿ’Old Town branch
  1. Bloom registers its name and gets a binder at the kiosks on Market Square. The binder starts with two cards about itself, and Bloom adds a card with the Old Town address.
  2. Mia asks her hotel front desk where Bloom is. The front desk checks the city name register, which says to ask the kiosks on Market Square.
  3. The front desk asks the kiosk. The kiosk reads the card in Bloom's binder and gives the Old Town address, and the front desk passes it on to Mia.
  4. Mia walks to the Old Town branch. The front desk keeps a sticky note with the address, so the next guest gets it without asking the kiosk.
Public and private hosted zonesStep 4 of 4
๐Ÿšง Staff-only yardPublic binder198key api.example.com A 198.51.100.7: 198.51.100.7012Staff binder10.key api.example.com A 10.0.1.25: 10.0.1.250db key db.example.com A 10.0.2.9: db 10.0.2.9โœฆโœฆโœฆโœฆโœฆ12๐ŸงณVisitorno such place๐ŸชงSquare kiosk๐Ÿง‘โ€๐Ÿ”งYard worker๐Ÿ’Yard help desk
  1. Bloom keeps two binders under the same name. The public one gives the order office's front door, the staff one gives its back door inside the yard.
  2. A visitor asks the square kiosk for the order office. The kiosk reads the public binder and gives the front-door address.
  3. A worker in the yard asks the same question at the yard help desk, which reads the staff binder and gives the back-door address.
  4. The stockroom is only in the staff binder. A visitor who asks the square kiosk for it is told there's no such place.
Alias records at the zone apexStep 4 of 4
Bloom's binderalikey example.com A ALIAS my-alb-123.us-east-1.elb.amazonaws.com: alias0123๐Ÿง‘โ€๐Ÿ’ผBloom's owner๐Ÿ›Ž๏ธHotel front desk๐ŸชงInformation kiosk๐ŸฌMarket hallnew IP .44
  1. The owner tries to put an "ask about Market Hall instead" card on the front page. The kiosk refuses, because that page already holds the binder's own cards.
  2. Instead the owner adds an alias card, "wherever the market hall's entrance is today". That one is allowed on the front page.
  3. The front desk asks about Bloom. The kiosk already knows where the market hall's entrances are today, so it hands back real street addresses in one go, free of charge.
  4. The market hall moves an entrance and tells the kiosk. Nobody touches Bloom's card, and the next answer already has the new address.
Routing policiesStep 4 of 4
๐Ÿ™‹Ana, from the west๐Ÿ™‹โ€โ™‚๏ธKenji, from the east๐ŸชงInformation kioskmultivalue๐Ÿ’West branch๐ŸŒธEast branch
  1. The kiosk uses shares. Nine visitors in ten get the west branch and one gets the new trial branch, wherever they come from. This time Kenji is the one in ten.
  2. Now the rule is the quickest trip. Ana gets the west branch and Kenji the east branch, because those are fastest to reach from where each of them is.
  3. Now the rule is by district. Visitors from the east district always get the east branch, which has staff who speak their language. Ana's district has no card, so she gets the "for everyone else" card.
  4. Now the rule is a short list. Ana gets both open branches at once and picks one herself.
Health checks and failoverStep 4 of 4
๐Ÿ›Ž๏ธHotel front desk๐ŸชงInformation kiosk๐Ÿ•ต๏ธInspectors๐Ÿ’Main branchhealthy๐ŸŒผBackup branch
  1. Every half a minute the inspectors ring the main branch, and it answers. So the kiosk gives the main branch's address.
  2. The main branch has a power cut. The inspectors ring and ring, and nobody picks up.
  3. The inspectors tell the kiosk, and from now on it gives out the backup branch's address instead.
  4. Power comes back and the main branch answers again. The inspectors let the kiosk know, and it switches back to the main branch.
TTLs and failover speedStep 4 of 4
๐ŸงณHotel guestcache 30 s๐Ÿ›Ž๏ธHotel front deskkept 1 min๐ŸชงInformation kiosknow says Backupโœ• โœ•๐Ÿ’ซMain branch๐ŸŒผBackup branch
  1. The guest asks the front desk, which asks the kiosk. The answer comes on a note marked good for five minutes, the front desk keeps it, and the guest walks to the main branch.
  2. The main branch closes and the kiosk switches to the backup straight away. But the front desk still has its note, so the next guest is sent to the closed branch.
  3. The note runs out. The front desk asks the kiosk again and gets the backup branch, on a note Bloom marked good for just one minute. The guest finally gets served.
  4. Some guests copy the address onto their hand and keep using it. Asking them to wash it off after half a minute means they go back to a closed branch for half a minute at most.

๐Ÿงฉ Key questions

Bloom wants its plain name, with nothing in front, to lead to its counters in the city-run market hall, whose entrances move now and then. Which card should go on the binder's front page?
An alias card that has the kiosk look up the hall's entrance each time. A redirect card isn't allowed on the front page, and a written address goes stale when the hall moves its entrances. The alias card is allowed there and always gives the current address.
The main branch closes. The inspectors noticed and the kiosk now gives the backup's address, yet some guests are still sent to the closed branch for a few minutes. Why?
Front desks and guests are still using the address on notes they wrote earlier. The kiosk switched straight away, but every note lasts until its time runs out. Short notes, and guests who don't keep copies for long, make the switch quicker.
Bloom uses the by-district rule, with cards for the east and west districts only. What happens to a visitor from the north district?
They're told there's no answer, so add a "for everyone else" card. The district rule doesn't guess. Without a card for everyone else, visitors from districts with no card get nothing.
A worker in the staff-only yard needs the back-door address of the order office. Why can't a visitor on the square get that address too?
The staff binder only answers questions from inside the yard. The staff binder sits at the yard help desk, and the square kiosk only has the public binder.