5 Distributed transactions

This chapter covers

  • Creating data consistency across multiple services
  • Using event sourcing for scalability, availability, lower cost, and consistency
  • Writing a change to multiple services with Change Data Capture (CDC)
  • Doing transactions with choreography vs. orchestration

In a system, a unit of work may involve writing data to multiple services. Each write to each service is a separate request/event. Any write may fail; the causes may include bugs or host or network outages. This may cause data inconsistency across the services. For example, if a customer bought a tour package consisting of both an air ticket and a hotel room, the system may need to write to a ticket service, a room reservation service, and a payments ...

Get Acing the System Design Interview now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.