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 RDS and Aurora

๐Ÿ›๏ธ Amazon RDS and Aurora: cheat sheet

๐ŸŽจ The analogyKeeping your records at a council-run records office that fixes the building, copies the files and keeps a twin office.
๐ŸŽ“ The regular explanationRelational databases that AWS runs for you. RDS handles patching, backups and failover to a synchronous standby; Aurora adds storage shared by all instances and spread across three Availability Zones. You still own the schema, the queries and how your app connects.
What AWS runs, what you ownStep 4 of 4
Photos and logbookS1key daily snapshot: S10L1key transaction log: L11L2key transaction log: L223๐ŸฅBea's bakery๐Ÿ›๏ธThe council๐ŸขRecords officeindexed๐ŸคFresh officenew endpoint
  1. The council fixes a weak lock on the records office, at a quiet hour Bea picked. Bea doesn't lift a finger.
  2. Each night the council photographs every cabinet, and it writes every single filing in a logbook as it happens.
  3. Bea does her own part. She writes the index cards that help the clerk find her orders fast, and she decides what to ask for.
  4. Bea asks the clerk to throw away the wrong drawer at 3:15. The council sets up a fresh office with the cabinets exactly as they were at 3:14.
Multi-AZ failoverStep 5 of 5
๐Ÿ˜๏ธ District A ๐Ÿ’ฅ๐Ÿ˜๏ธ District Bpoints here๐ŸฅBea's bakery๐ŸชงSignpostโœ• โœ•๐Ÿ’ซMain office๐ŸคTwin officenow main
  1. The signpost points at the main office, so Bea's form goes there.
  2. The clerk files the form in the twin office too, and only then tells Bea "done". The twin keeps its doors shut to visitors.
  3. The main office floods. Bea's next form can't get in.
  4. The council opens the twin office and turns the signpost to point at it.
  5. Bea follows the signpost again, ends up at the twin office, and every form she was told "done" about is there.
Read replicasStep 4 of 4
๐ŸฅBea's bakery๐ŸขMain office๐Ÿ“–Reading room 1๐Ÿ“–Reading room 2
  1. Bea changes a price at the main office, and the clerk says "done" straight away. The reading rooms haven't heard yet.
  2. A moment later, the courier brings a copy of the change to each reading room.
  3. The accountant and the delivery driver look things up in the reading rooms, so the main office stays free for forms.
  4. Someone tries to hand in a form at a reading room. It's turned away; forms only go to the main office.
Aurora's shared storageStep 5 of 5
๐Ÿฆ Shared vault4 of 6 = filedpoints hereDistrict A shelveso1key 2 copies in AZ a: o10o2key 2 copies in AZ a: o2โœฆโœฆโœฆโœฆโœฆ12District B shelveso1key 2 copies in AZ b: o10o2key 2 copies in AZ b: o2โœฆโœฆโœฆโœฆโœฆ12District C shelveso1key 2 copies in AZ c: o10o2key 2 copies in AZ c: o2โœฆโœฆโœฆโœฆโœฆ12๐ŸฅBea's bakery๐ŸชงMain signpost๐ŸชงReading signpostโœ• โœ•๐Ÿ’ซMain counter๐Ÿง‘โ€๐ŸซReading counter 1takes forms๐Ÿง‘โ€๐ŸซReading counter 2
  1. Bea follows the main signpost to the main counter. The counter puts her form on the vault's shelves in all three districts.
  2. Once four of the six copies are on the shelves, the form counts as filed, and Bea hears "done".
  3. Readers follow the reading signpost to a reading counter. Each counter looks in the very same vault, so it's barely behind.
  4. The main counter closes suddenly. Bea's next form can't get through.
  5. Reading counter 1 just starts taking forms, and the main signpost turns to it. No files had to move; they were in the vault all along.
Connection limits and RDS ProxyStep 4 of 4
10 connections๐Ÿง‘Helper 1๐Ÿ‘ฉHelper 2๐Ÿง”Helper 3๐Ÿ’‚Doormanshared๐ŸขRecords office10/100 in use
  1. Two of Bea's helpers each grab a big batch of service windows, then mostly stand there. Every window is taken.
  2. A third helper arrives and is turned away at the door, even though the clerks are mostly idle.
  3. The council puts a doorman at the entrance. Every helper talks to the doorman, and the doorman keeps just a few windows open.
  4. The doorman passes each helper's form through whichever window is free. Many helpers now share a few windows.
A Spring app rides out a failoverStep 4 of 4
points here๐Ÿง‘Bea's helper๐ŸชงSignpostโœ• โœ•๐Ÿ’ซCounter A๐Ÿง‘โ€๐ŸซCounter Btakes forms
  1. The helper's address card names the signpost. The signpost points at counter A, and the form goes there.
  2. Counter A shuts in the middle of an errand. The half-finished errand doesn't count, so nothing was half-done.
  3. Counter B takes over, and the signpost turns to it. The helper lets go of the old window and reads the signpost again.
  4. The helper tries the whole errand once more, from the start, and this time it's done.

๐Ÿงฉ Key questions

Bea asks the clerk for every order ever, sorted by colour, and it takes ages. Whose job is it to fix?
Bea's: she writes the index cards and decides what to ask for. The council looks after the building, the photos and the twin office. How the files are organised is up to Bea.
The main office floods. Why doesn't Bea lose any form she was told was done?
Every form was filed in the twin office before the clerk said done. The twin office already has everything, so the council just turns the signpost to it.
In the newest offices, why can a reading counter take over from the main counter so quickly?
The files sit in a shared vault, so there's nothing to move or catch up on. Six copies of every page sit in three districts. The counters are just ways in.
Bea's helpers keep getting turned away at the door, although the clerks are mostly idle. What helps?
A doorman who keeps a few windows open and shares them between helpers. Most helpers stand at their window doing nothing. Sharing windows lets many helpers use a few.
Counter A shuts in the middle of the helper's errand. What should the helper do?
Let go of the old window, read the signpost again and redo the whole errand once. A half-finished errand never counts, so redoing it from the start is safe, as long as doing it twice wouldn't hurt.