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 ElastiCache

๐Ÿช Amazon ElastiCache: cheat sheet

๐ŸŽจ The analogyHiring an agency to run your shop's express counter, staff and standby clerk included, while you choose what it stocks.
๐ŸŽ“ The regular explanationAWS's managed in-memory cache, running Valkey, Redis OSS or Memcached inside your VPC, either as node-based clusters you size (with shards, replicas and Multi-AZ failover) or as ElastiCache Serverless that scales itself. MemoryDB is the durable sibling for when the data must not be lost.
The agency runs the counterStep 5 of 5
๐Ÿง”Omar๐Ÿง‘โ€๐Ÿ’ผExpress counterempty again๐Ÿ—„๏ธ Storeroom๐ŸขThe agency
  1. A customer wants blue paint. Omar looks at the express counter first, but there's none there.
  2. Omar walks to the storeroom, brings the paint back and leaves some on the counter for the next customer.
  3. The next customer asks for blue paint, and it's handed over from the counter in a blink.
  4. The counter clerk suddenly drops out. Omar doesn't have to do anything about it; the agency notices.
  5. The agency sends a fresh clerk, but their shelf starts empty. Omar walks to the storeroom again until it fills back up.
The "as many as needed" planStep 4 of 4
๐Ÿข The agency's clerks๐Ÿง”Omarsame desk๐Ÿ›Ž๏ธFront desk1 clerk๐Ÿง‘โ€๐Ÿ’ผClerk 1
  1. On a quiet morning, Omar asks the front desk for nails. One clerk behind it is plenty.
  2. The lunchtime crowd arrives. The agency sees the queue and adds two more clerks by itself. Omar didn't ask for them.
  3. Omar still talks to the same front desk. The desk passes each request to whichever clerk is free.
  4. In the evening the shop goes quiet, so the agency sends the extra clerks home, and Omar stops paying for them.
Shards and the configuration endpointStep 5 of 5
0-81918192-1228712288-16383๐Ÿง”Omar๐ŸชงBoard at the door๐Ÿง‘โ€๐Ÿ’ผSection 1has paint๐Ÿ‘ฉโ€๐Ÿ’ผSection 2๐Ÿง‘โ€๐Ÿ”งSection 3has nails
  1. Omar reads the board at the door. It says which section looks after which item numbers, and he keeps a copy.
  2. Paint's number belongs to section 1 and nails' number to section 2, so Omar goes straight to each one.
  3. The shop grows, so the agency opens section 3 and moves some numbers over to it, nails included, while the shop stays open.
  4. Omar asks section 2 for nails, using his old copy of the board. The clerk says "that's moved to section 3".
  5. Omar updates his copy of the board and gets the nails from section 3.
Replicas and Multi-AZ failoverStep 5 of 5
๐Ÿฌ North hall๐Ÿฌ South hallpoints here๐Ÿง”Omar๐ŸชงMain sign๐ŸชงPick-up sign๐Ÿง‘โ€๐Ÿ”งNew standbynew standby๐Ÿ‘ฉโ€๐Ÿ’ผStandby clerkmain clerk now
  1. Omar follows the main sign to the main clerk and puts red paint on the counter. The clerk says "done".
  2. A moment later the standby clerk in the south hall copies it. Customers who only want to look follow the pick-up sign to the standby.
  3. Omar adds glue, and the main clerk says "done", then drops out before passing the glue on to the standby.
  4. Within seconds the agency makes the standby the main clerk and turns the main sign. The glue is missing from the counter.
  5. The agency sends a new standby to the north hall, which copies the shelves, and the pick-up sign points at it.
MemoryDB's Multi-AZ transaction logStep 4 of 4
๐Ÿ“’ The logbookssafely loggedLogbook, north hallA+5key points:ana +5: A+5012Logbook, south hallA+5key points:ana +5: A+5012Logbook, east hallA+5key points:ana +5: A+5012๐Ÿง”Omarโœ• โœ•๐Ÿ’ซMain clerk๐Ÿ‘ฉโ€๐Ÿ’ผStandby clerkmain clerk now
  1. Omar keeps loyalty points only at the counter now. He adds five points for Ana, and the clerk writes it in the logbooks in three halls.
  2. Only once the change is in the logbooks does the clerk say "done". That's why changes take a moment longer.
  3. The main clerk drops out straight after saying "done".
  4. The standby reads the logbook, takes over, and still has Ana's five points. Nothing she was told "done" about is lost.
Inside the VPC, with TLS and authStep 4 of 4
๐Ÿšช Staff-only back room๐Ÿ•ต๏ธStranger๐Ÿง”Omarsealed envelopes๐Ÿ’‚Door guard๐Ÿง‘โ€๐Ÿ’ผExpress counteruser: orders-app
  1. A stranger from the street tries to reach the counter. They aren't on the guard's list, so they get nowhere.
  2. Omar is on the list. The guard lets him through, and they agree to use sealed envelopes for every word.
  3. Omar gives an old password, and the clerk refuses to hand anything over.
  4. With the right password, the clerk knows who it is, and hands over the paint.

๐Ÿงฉ Key questions

The counter clerk drops out and the agency sends a fresh one with an empty shelf. What should Omar do?
Fetch things from the storeroom as usual, and leave copies on the counter again. The counter only holds quick copies. The storeroom still has everything, so the shelf fills back up as customers ask.
Omar's main clerk says done to the glue, then drops out before the standby copied it. What happens after the standby takes over?
The glue is missing, so Omar fetches it from the storeroom again. The standby copies a moment after the main clerk says done, so the very latest change can be lost. For a counter that's fine.
Omar wants to keep loyalty points only at the counter, with no copy anywhere else. Which service fits?
MemoryDB, whose clerks write every change in logbooks in several halls before saying done. More standbys still copy after done, so a change can still vanish. The logbooks make each done stick.
The agency opens a new section and moves the nails there. Omar asks the old section with his old copy of the board. What happens?
The clerk says it's moved to section 3; Omar updates his board and goes there. Sections only tell you where to go. Omar keeps his own copy of the board and updates it when told.
Omar's helpers can't reach the counter at all; their requests just hang. What is the likely cause?
The helpers aren't on the door guard's list. A wrong password gets a clear no from the clerk. Not being on the list means you never reach the counter at all.