AlgoViz

Microservices or monolith

easy 28 min

A monolith is one program, built and released as a whole.

Remember it

The few things worth knowing cold, and how to make them stick.

Memory hook

One castle to maintain together, or many houses to rebuild one by one.

One big workshop is warm and quick until the candle bench smokes. A lane of huts keeps the smoke in one hut, and asks for a walk in the rain and four keys.

Cheat sheet

Monolith
one release
Microservice
own release, own data
Default
modular monolith
Chain of 5 at 99.9%
about 99.5%
Team size
two pizzas
Migration
strangler fig
Worst of both
distributed monolith
Crossover
10 to 50 people, a rule of thumb

Spot it when you see

  • Releases queue up.
  • One part needs very different hardware.
  • Sensitive data needs a smaller wall.
  • More than one team in one module.

Tricks that stick

  • SPLIT: Single responsibility, Polyglot, Loose coupling, Independent release, Team ownership.
  • If they always ship together, they are one service.
  • Split for a reason you can say in one sentence.

Do not forget

  • Splitting before the domain is understood.
  • Sharing tables between services.
  • Long chains of calls.
  • No traces or central logs.
  • Rewriting everything at once.