Microservices and service boundaries
Trade local calls for independent ownership deliberately.
The problem and the pattern
Separating booking and billing can let teams deploy independently. It also introduces network failures, distributed tracing, versioned contracts, and asynchronous consistency. Start a service boundary around a cohesive capability with a clear owner and an operational reason to separate.
Follow the flow
Make it concrete
This excerpt isolates the concept. Connect it to the booking API as you work through the exercise.
Booking service owns reservations
Billing service owns charges
Contract: BookingReserved v1
Failure: billing unavailable does not erase the reservationTrade-offs
- Independent scaling and releases require independent data ownership.
- A shared database can recouple supposedly independent services.
- A modular monolith is a useful baseline for comparing operational cost.
When to avoid it
Avoid splitting services solely by technical layer or to imitate a larger company.
Your turn
Name three costs that appear when a module becomes a service.
Reveal a worked answer
Network calls can fail independently, releases need contract compatibility, and data cannot be updated with one local transaction. Add observability, bounded retries, and a recovery workflow before splitting.