5 Transactions and queries in microservices

This chapter covers

  • The challenges of consistency in a distributed application
  • Synchronous and asynchronous communication
  • Using sagas to develop business logic across multiple services
  • API composition and CQRS for microservice queries

Many monolithic applications rely on transactions to guarantee consistency and isolation when changing application state. Obtaining these properties is straightforward: an application typically interacts with a single database, with strong consistency guarantees, using frameworks that provide support for starting, committing, or rolling back transactional operations. Each logical transaction might involve several distinct entities; for example, placing an order ...

Get Microservices in Action 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.