17 / 25 · Service boundaries
Microservices
Microservices split a system into independently deployable business services. The useful boundary is ownership of a capability and its data, not an arbitrary number of small functions or servers.
Follow a ticket-booking example to decide which service owns the catalog, seat reservations, payments and notifications. Compare these boundaries with a modular monolith before choosing an architecture.
What you will practise
- Choose business ownership
- compare synchronous/asynchronous work
- justify a service boundary
Before you start: Business invariant, transaction and network call.
About 4 minutes · offline-generated English female narration · captions included. Diagrams are conceptual; timings are illustrative.
Download MP4CaptionsListen without the video
Download audioChapters and full transcript
Let us understand microservices. A school has a library team, accounts team and transport team. Each owns a different responsibility and communicates through clear requests. If every tiny task needs a meeting with every team, work becomes slower. More teams are helpful only when their boundaries reduce coordination rather than create it. Microservices split a system into independently deployable business services. The useful boundary is ownership of a capability and its data, not an arbitrary number of small functions or servers.
Follow the normal path. Name business responsibilities before drawing services. Catalog descriptions and authoritative seat reservations have different ownership and correctness requirements. Each capability owns its protected state and exposes contracts. Giving every service write access to every table defeats much of the intended independence. SeatSpot may separate booking, catalog and notifications when team ownership, scaling or deployment needs justify it. A small team can often start with a modular monolith and preserve those boundaries without network overhead.
Now change one condition. The booking workflow contacts payments. That call can time out or succeed remotely while its response is lost; it is not a local transaction. A common misunderstanding is this: Every function should become a microservice. Fine-grained network boundaries can add latency, coordination and partial failures without useful autonomy. Think about this. Catalog, booking and payment must deploy together after every change. Are they operationally independent? Pause the video and make your prediction. Probably not yet. Inspect shared schemas and contracts before calling separate processes independent services.
Let us reason with a concrete example. A confirmation requires catalog lookup, seat reservation, payment and notification. Putting all four behind sequential network calls increases latency and failure combinations. Notification can be asynchronous; reservation/payment need an explicit state machine and reconciliation. Start with the required invariant and workflow. Separate a capability only when the autonomy benefit outweighs the distributed coordination cost. These figures are teaching examples, not production guarantees.
Turn the idea into a design decision. Confirmation can publish notification work after reliable business-state coordination. A slow email provider need not occupy the booking request indefinitely. Old and new callers may coexist. Test contract compatibility and observe version-specific errors instead of requiring every service to deploy in lockstep. When you try the practice task, look for this result. Separate deployment earns its complexity only when ownership and autonomy are useful.
Check your understanding. For a small team, a modular monolith may satisfy the same domain boundaries with fewer moving parts. Choose services from requirements rather than fashion. Here is a challenge. A two-person team has low traffic and no independent deployment needs. Must it use microservices? Pause before the answer. No. A modular monolith can keep clear domains with simpler transactions and operations. Revisit extraction when measured scaling, ownership or release constraints justify it. For an interview, discuss contracts, state machines and asynchronous notification. Say what you would measure, not only which tool you would buy.
Start with an everyday picture
A school has a library team, accounts team and transport team. Each owns a different responsibility and communicates through clear requests. If every tiny task needs a meeting with every team, work becomes slower. More teams are helpful only when their boundaries reduce coordination rather than create it.
Why SeatSpot needs this
SeatSpot may separate booking, catalog and notifications when team ownership, scaling or deployment needs justify it. A small team can often start with a modular monolith and preserve those boundaries without network overhead.
Trace one step at a time
Move through the diagram at your pace. Teal paths are active; unavailable components are labelled.
Find the capabilities
Name business responsibilities before drawing services. Catalog descriptions and authoritative seat reservations have different ownership and correctness requirements.
Read all six mechanism steps
Find the capabilities
Name business responsibilities before drawing services. Catalog descriptions and authoritative seat reservations have different ownership and correctness requirements.
Own the data
Each capability owns its protected state and exposes contracts. Giving every service write access to every table defeats much of the intended independence.
Cross a network boundary
The booking workflow contacts payments. That call can time out or succeed remotely while its response is lost; it is not a local transaction.
Decouple optional work
Confirmation can publish notification work after reliable business-state coordination. A slow email provider need not occupy the booking request indefinitely.
Deploy compatibly
Old and new callers may coexist. Test contract compatibility and observe version-specific errors instead of requiring every service to deploy in lockstep.
Justify the complexity
For a small team, a modular monolith may satisfy the same domain boundaries with fewer moving parts. Choose services from requirements rather than fashion.
Pause and make a prediction
Catalog, booking and payment must deploy together after every change. Are they operationally independent?
Correct a common misunderstanding
Claim to question: Every function should become a microservice.
Better explanation: Fine-grained network boundaries can add latency, coordination and partial failures without useful autonomy.
Draw a booking ownership map
- Assign catalog, booking, payment and notification ownership.
- Mark which operations must protect seat allocation.
- Compare a modular monolith with extracting one justified capability.
Check what you can explain
This is your self-check, not an automated grade. Try again without the diagram tomorrow.
0 of 3 goals checked. Choose one remaining idea to practise next.
Teach it back
Without looking, explain what this component changes, what it does not solve and what happens if it fails. Use the animation to check your explanation, then switch to Engineering.
Engineering model and trade-offs
Choose boundaries from domain invariants and team ownership. Avoid a shared database schema that every service edits freely; it couples deployments even if applications have different names.
Network calls fail partially and add latency. Cross-service updates need explicit workflows, idempotency and reconciliation. A local transaction cannot automatically protect a business invariant spread across unrelated stores.
Independent deployment requires compatible contracts, observability, testing and operations. If services must always deploy together, investigate whether the boundary or shared dependencies are wrong.
Microservices example: booking, payment and notification
A confirmation requires catalog lookup, seat reservation, payment and notification.
Reason with the numbers
Putting all four behind sequential network calls increases latency and failure combinations. Notification can be asynchronous; reservation/payment need an explicit state machine and reconciliation.
Make a decision
Start with the required invariant and workflow. Separate a capability only when the autonomy benefit outweighs the distributed coordination cost.
Service boundaries and data ownership
Catalog: owns public event descriptions
Booking: owns seat reservation state
Payments: owns provider integration and reconciliation
Notifications: owns delivery jobs
Contracts connect owners; services do not edit each other tables.A proposed domain sketch, not a claim that all systems need four services or that network calls provide atomic transactions.
Where this is used
- Independent teams or capabilities with different release/scaling needs.
- Domains with clear data and operation ownership.
Common mistakes
- Splitting by technical layer into chatty services.
- Sharing mutable tables without ownership.
- Treating a modular monolith as inherently inferior.
Practise a reasoned answer
Answer aloud or write notes before opening the reference. These prompts teach reasoning and trade-offs; they are not claimed questions from a particular company.
How would you choose service boundaries?
Choose a practice depth
- Foundation
- Describe one capability and its owner.
- Practical
- Discuss contracts, state machines and asynchronous notification.
- Advanced
- Defend boundary choices, cross-service invariants, deployment independence and operating cost.
Self-check rubric
- State the required user outcome and the relevant invariant.
- Explain the normal path and one failure path.
- Name a cost or consistency/latency trade-off.
- Say what you would measure or test before trusting it.
For deeper practice, connect this topic to the previous lesson and identify a shared bottleneck. A longer answer is not automatically a better answer.
Try it before viewing the solution
A two-person team has low traffic and no independent deployment needs. Must it use microservices?
Check one key idea
Your explanation and interview notes
Saved only in this browser when storage is available. Export a backup from the course page before clearing browser data or moving devices.
Loading your local notes…
Official references and next reading
The explanation, fictional examples and animations are original teaching material. Vendor behavior depends on the specific product/version; use its documentation before deploying.