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 Service mesh

๐Ÿข Service mesh: cheat sheet

๐ŸŽจ The analogyA concierge at every flat door who checks badges, retries deliveries and logs every one.
๐ŸŽ“ The regular explanationA layer of proxies next to every workload, configured by a central control plane, that gives service-to-service traffic mTLS, retries, timeouts, traffic splitting and telemetry without changing application code.
A concierge at every doorStep 4 of 4
๐Ÿšช Ana's flat๐Ÿšช Ben's flat๐ŸขBuilding officenot on the path๐Ÿ™‹โ€โ™€๏ธAna๐Ÿ›Ž๏ธAna's conciergelocked๐Ÿ›Ž๏ธBen's conciergechecked๐Ÿ™‹โ€โ™‚๏ธBen
  1. The building office sends the same rules to every concierge. Nobody has to tell Ana or Ben anything.
  2. Ana writes to Ben as she always did, but she just hands the letter to her own concierge. Her concierge walks it over to Ben's concierge in a locked pouch.
  3. Ben's concierge checks where the letter came from, notes it down and hands it in. Ben reads it like any other letter.
  4. The reply goes back the same way, concierge to concierge. The office never carried a single letter.
Injection and interceptionStep 4 of 4
๐Ÿ  Ana's flat๐Ÿ“ Moving-in formโœ• โœ•๐Ÿ’ซBuilding office๐Ÿ™‹โ€โ™€๏ธAnarewired door๐Ÿ›Ž๏ธAna's conciergelast rules๐ŸšชBen's door
  1. Ana moves into a new flat. The building office posts a concierge at her door straight away, without anyone asking.
  2. The office sends the concierge its rules. Now it knows every door in the building and how to reach it.
  3. The door has been rewired. Ana aims her letter straight at Ben, but it lands with her concierge first, who takes it on to Ben's door.
  4. The office closes for the afternoon. The concierge keeps working with the last rules it was given, and Ben's reply still comes back.
Badges and locked pouchesStep 5 of 5
locked๐ŸขBuilding office๐Ÿ›Ž๏ธAna's conciergefresh badge๐Ÿ›Ž๏ธBen's conciergestrict rule
  1. Each concierge asks the building office for an ID badge, with its flat's name on it.
  2. The office checks who is asking and hands out the badges. Each one says which flat it belongs to.
  3. Before a letter changes hands, both concierges show their badges to each other. Then the letter travels in a locked pouch.
  4. The office has now sent the strict rule. Someone without a badge walks up to Ben's door with a letter, and the concierge turns them away.
  5. Badges only last a day. Well before hers runs out, Ana's concierge picks up a fresh one, and letters keep flowing.
Splitting, retries and ejectionStep 5 of 5
๐Ÿ  Ben's old flat๐ŸขBuilding office๐Ÿ™‹โ€โ™€๏ธAna๐Ÿ›Ž๏ธAna's concierge50/50๐ŸšชDoor 1๐ŸšชDoor 2๐ŸกBen's new flat
  1. The office sends Ana's concierge a new rule. Take 9 letters in 10 to Ben's old flat and 1 in 10 to his new one.
  2. Ana keeps writing to Ben as usual. Her concierge takes most letters to the old flat, and now and then one to the new one.
  3. Nobody answers at door 1. The concierge doesn't stand there forever. It knocks once at door 2 instead, gets an answer and takes it back to Ana.
  4. Door 1 keeps failing, so the concierge stops knocking there for a while. Letters go to the doors that answer.
  5. The new flat copes well, so the office sends a new rule and half the letters go there. Door 1 is fixed and back in use.
The delivery book and the reference numberStep 4 of 4
Ana's flatBen's flatCleo's flatDelivery book ยท 1 story7-1key trace 7: orders to payments (client): 7-107-2key trace 7: orders to payments (server): 7-219-1key trace 9: payments to fraud, cut off: 9-127-3key trace 7: payments to fraud: 7-3โœฆโœฆโœฆโœฆโœฆ345๐Ÿ™‹โ€โ™€๏ธAna๐Ÿ›Ž๏ธAna's concierge๐Ÿ™‹โ€โ™‚๏ธBen๐Ÿ›Ž๏ธBen's concierge๐Ÿ™‹Cleo๐Ÿ›Ž๏ธCleo's concierge
  1. Ana's letter goes out with reference number 7 on it, and the concierges carry it to Ben.
  2. Both concierges write the delivery in the book, with who, how long and whether it worked. Ana and Ben did nothing.
  3. Ana's letter makes Ben write to Cleo, but Ben forgets to copy the number. The book now shows his letter as a new, unrelated story.
  4. Next time Ben copies number 7 onto his letter. Now the book tells one story from Ana to Cleo.
One concierge desk per floorStep 4 of 4
Floor 1Floor 2๐ŸขBuilding office๐Ÿ™‹โ€โ™€๏ธAna๐Ÿ™‹โ€โ™‚๏ธDan๐Ÿ›Ž๏ธFloor 1 deskbadges and locks๐Ÿ›Ž๏ธFloor 2 desk๐Ÿ™‹โ€โ™‚๏ธBen๐Ÿ“ฎSorting roomreads letters
  1. No concierge at Ana's door any more. Her letter goes to the shared desk on her floor, which checks badges and locks the pouch for her.
  2. Dan lives on the same floor and uses the same desk. One desk serves every flat on the floor, so far fewer people are needed.
  3. Ben's letters now need splitting between two flats, so the office opens a sorting room for them. Letters to Ben stop there to be read and sorted.
  4. Ben's reply goes back the same way, through the sorting room and both floor desks, to Ana.

๐Ÿงฉ Key questions

The building office closes for an afternoon. What happens to the letters?
The concierges keep delivering with the last rules they were given. The office only writes rules. The concierges carry the letters, so they carry on.
Ana forgets the concierge exists and aims her letter straight at Ben. Why does it still go through her concierge?
Her door was rewired so every letter in or out lands with the concierge. Nothing changes for Ana. The rewiring sends everything past the concierge.
When nobody answers at Ben's door, Ana's concierge sometimes knocks again. What must Ben's own letter-handling cope with?
Getting the same letter twice, without paying twice. The first letter may have arrived even though no answer came back, so a second one can show up.
Ana's letter makes Ben write to Cleo. What does Ben have to do so the delivery book shows one story?
Copy the reference number from Ana's letter onto his letter to Cleo. A concierge can't see why Ben wrote, so the reference number has to come from Ben.
Why would a building swap a concierge at every door for one shared desk per floor?
Far fewer people to pay, and a sorting room only where letters need reading. The floor desk still checks badges and locks pouches. Only the extra sorting moves to a room used when needed.