Lesson 12 of 17
27. Monolith vs Microservices

Memory card and where the analogy breaks

3 min read+10 XP

The memory card (tear this page out)

#QuestionMemory code
27.1Monolith?One kitchen, one menu, one door
27.2Monolith strengths?One kitchen is fast and simple until there are too many cooks
27.3Modular monolith?One kitchen, but every station guards its own shelf
27.4Microservices?Each stall runs itself, from pantry to counter
27.5Real cost?Every stall you split off is another queue, another lock, another thing to run
27.6Boundaries?Cut where the cooks rarely talk
27.7Service discovery?Check the board, not your memory: stalls move
27.8Sync vs async?Wait at the counter only for what you're about to eat
27.9Database per service?Each stall keeps its own pantry and asks politely for the rest
27.10When to split?Split for teams and needs you can name, one stall at a time

The whole chapter in one line: Start with a well-moduled monolith, split out services only for named team, scaling or isolation needs, cut along business capabilities, give each service its own data, and keep synchronous chains short.

Where the analogy breaks

  • Food court stalls rarely depend on each other. Services often do, and a slow dependency can freeze the caller unless it has timeouts.
  • A stall's pantry is physical. Data can be copied, so services can keep their own copies of others' data, updated by events.
  • Opening a stall is slow and visible. Creating a service is a few commands, which is exactly why teams end up with too many.

Quick check

Five questions on this chapter. Pick an answer, then check it.

quiz