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 AWS Regions and Availability Zones

πŸ₯– AWS Regions and Availability Zones: cheat sheet

🎨 The analogyA bakery chain with branches in many cities, each city with several bakeries that have their own power and water.
πŸŽ“ The regular explanationAWS runs separate geographic Regions, each made of at least three isolated Availability Zones with independent power and networking, so you spread a workload across zones to survive a data-centre failure and across Regions for latency, disaster recovery and data residency.
Regions and Availability ZonesStep 5 of 5
πŸ™οΈ Dublin3 AZsπŸŒ† Tokyofar awayfast linkfast linkπŸ™‹Ana🏠Dublin bakery Aown power🏑Dublin bakery Bown power🏘️Dublin bakery Cown power🏯Tokyo bakery A🏯Tokyo bakery C🏯Tokyo bakery D
  1. The chain bakes in Dublin. Inside the city there are three separate bakeries, in different parts of town.
  2. Each bakery has its own power line and water, so a power cut in one part of town leaves the other two baking.
  3. Fast vans run between the three bakeries, so a fresh order line reaches the next bakery in minutes.
  4. Ana orders bread. Her order goes to bakery A, which passes a copy to bakery B straight away.
  5. Far away, Tokyo is a whole other city with bakeries of its own. Nothing moves there unless the chain sends it.
Surviving a lost Availability ZoneStep 5 of 5
🏠 Bakery A πŸ’₯🏑 Bakery BπŸ™‹CustomersπŸ›ŽοΈOrder deskβœ• βœ•πŸ’«Baker AskippedπŸ‘©β€πŸ³Baker BMain order bookmainStandby order booknew main
  1. The order desk sends an order to baker A, who writes it in the main order book. The standby book copies the line before the order counts as done.
  2. The next order goes to baker B, in the other bakery. Both bakers share the work, and both use the main book.
  3. Oh no, bakery A loses power! Baker A and the main order book go dark together.
  4. The order desk notices baker A isn't answering and sends every order to baker B instead.
  5. The standby book already has every line, so it becomes the main book. No finished order is lost.
Why use more than one RegionStep 5 of 5
πŸ™οΈ Dublin πŸ’₯🏰 FrankfurtπŸŒ† TokyoπŸ™‹Ana in DublinπŸ™‹β€β™‚οΈKenji in Tokyofastβœ• βœ•πŸ’«Dublin bakerπŸ‘©β€πŸ³Frankfurt bakerπŸ§‘β€πŸ³Tokyo bakerDublin order bookEU onlyFrankfurt copynow mainTokyo order book
  1. Kenji in Tokyo orders from Dublin. The bread has to travel halfway round the world, so it arrives late.
  2. The chain opens a Tokyo branch. Now Kenji's bread is baked close by, and his order details stay in Japan.
  3. European order details must stay in Europe, so Dublin copies its book to Frankfurt only. The copy travels slowly and is a little behind.
  4. A huge storm closes every bakery in Dublin at once.
  5. Ana's orders go to Frankfurt, whose copy becomes the main book. Only the last line or two that hadn't arrived yet are missing.
Global, Regional and zonalStep 5 of 5
🏠 Bakery A πŸ’₯zonal🏑 Bakery BattachedπŸͺͺStaff badge listglobalπŸ“žChain phone bookglobalDublin pantryRegionalβœ• βœ•πŸ’«Oven ATray cupboard A♨️Oven B
  1. A badge made once works in every city, and the chain's phone book sends callers to the right one. These belong to the whole chain.
  2. Dublin's pantry belongs to the city. Its sacks are spread across all the bakeries, but it isn't in Tokyo.
  3. Oven A and its tray cupboard both stand inside bakery A. The cupboard can't be carried to another bakery's oven.
  4. Bakery A loses power, and oven A and its cupboard go dark with it.
  5. Oven B, in another bakery, still gets flour from the city pantry, because the pantry never lived in just one bakery.
AZ names and AZ IDsStep 4 of 4
πŸ™οΈ The citysame zonesame zoneπŸ™‹Ana's teamπŸ™‹β€β™‚οΈBen's team🏠1 Mill Lane🏑2 Oak Roadboth teams🏘️4 Bridge Street
  1. On Ana's map, bakery A is the one at 1 Mill Lane.
  2. On Ben's map the letters were shuffled, so his bakery A is at 4 Bridge Street.
  3. They agree to bake side by side in bakery A, but end up in different buildings, with vans running between them all day.
  4. So they use the street address, which is the same on every map. Both pick 2 Oak Road and really are side by side.

🧩 Key questions

Your bread is baked in one Dublin bakery only. That bakery loses power. What happens?
No bread until the power is back, because nothing was baking anywhere else. Each bakery can lose power on its own. To keep baking, bake in at least two bakeries.
Why can the standby order book copy every line before an order counts as done, but the Frankfurt copy can't?
Bakeries in one city are minutes apart, but cities are far apart, so waiting each time would slow every order. Distance decides it. Close bakeries can wait for each other; far cities can't, so the far copy is a little behind.
Every bakery in Dublin closes in one big storm. What keeps the bread coming?
A branch in another city with a copy of the order book. Bakeries in one city can all be hit by the same storm. Only another city escapes it.
Ana and Ben both pick bakery A to bake side by side. Why might they end up in different buildings?
The letters on their maps may be shuffled, so they should agree on the street address instead. The letters belong to each map. The street address is the same for everyone.