Building Microservices
ReadTakeaways
Microservices are about independent deployability, not small codebases. The book is at its best when it tells you not to use microservices yet.
The Core Ideas
- Model services around business capabilities (bounded contexts), not technical layers.
- Information hiding: a service owns its data. A shared database is a distributed monolith waiting to happen.
- Independent deployability is the goal. If you have to release five services together, you have not gained anything.
- Start with a monolith when the domain is unclear. Split along seams once you understand them.
Migrating: Strangler Fig
- monolith
- put a proxy in front
- route one capability to a new service
- repeat
- monolith shrinks away
Distributed Transactions
Sagas instead of two-phase commit: a sequence of local transactions with compensating actions if a later step fails. Changed how I think about multi-step agent workflows too — every tool call is a step you might need to undo.