How do you decide microservice boundaries?
basicDraw boundaries around business capabilities (DDD bounded contexts) so a service owns its data and changes independently; avoid splitting by technical layer.
- Signals of a good boundary: high cohesion, low coupling, one team owns it, independent deploy and scaling, its own database.
- Smells: services that must deploy together, chatty synchronous call chains, shared DB tables, distributed transactions everywhere (distributed monolith).
- Start with a modular monolith and extract when team size or scaling needs justify it.
- One service per entity? No, that yields anemic CRUD services and heavy cross-service joins.
- Can two services share a database? Not if you want independence; share through APIs or events.