Architecture · Intermediate · 10 min

Sagas & Distributed Transactions

Track an order across services and define compensation for partially completed work.

STEP 1 / 11
Partially complete a booking — isometric concept diagramCross-service workflows need an explicit completion model. Components: 1. Traveller. Representative clients, not a literal user count; 2. Trip coordinator. Logical component or processing boundary; 3. Flight service. Logical component or processing boundary. Connections: 1. Traveller to Trip coordinator: Partially complete a booking; 2. Trip coordinator to Traveller: Reply: Trip coordinator; 3. Trip coordinator to Flight service: Partially complete a booking; 4. Flight service to Trip coordinator: Reply: Flight service. Illustrations are conceptual, not deployed capacity or user counts.Traveller → Trip coordinator: Partially complete a booking1Trip coordinator → Traveller: Reply: Trip coordinator2Trip coordinator → Flight service: Partially complete a booking3Flight service → Trip coordinator: Reply: Flight service4Traveller: Representative clients, not a literal user count1TravellerRepresentative clients, not aliteral user countTrip coordinator: Logical component or processing boundary2Trip coordinatorLogical component or processingboundaryFlight service: Logical component or processing boundary3Flight serviceLogical component or processingboundary
1Traveller2Trip coordinator3Flight service
  1. 1Traveller → Trip coordinatorRequestPartially complete a booking
  2. 2Trip coordinator → TravellerReplyReply: Trip coordinator
  3. 3Trip coordinator → Flight serviceRequestPartially complete a booking
  4. 4Flight service → Trip coordinatorReplyReply: Flight service

Conceptual illustration · figures do not imply user counts, deployed capacity or replica counts.

3 components visible · Traveller + Trip coordinator + Flight service highlighted

Orange: request / query · Blue: reply · Purple: event / control · Arrows show direction; speed is illustrative.

You’ll learn

  • Persist which steps have actually completed.
  • Compensation is not database rollback across services.
  • Recovery work has its own failure modes.

PUT THE IDEA TO WORK

From learning to practice

RELATED PATTERNS

Transactional outbox ↗

Saga ↗

Further reading

Microsoft · Saga pattern ↗