About Eventuate Tram
Eventuate Tram is a platform for managing distributed data in a microservice architecture. It enables a services to send and receive messages as part of an database transaction. It does this by implementing the Transactional outbox pattern. This pattern is foundation of maintaining data consistency within a microservice architecture. It is used to implement the Saga pattern, which implements transactions multiple services, and the CQRS pattern, which implements queries that retrieve data from multiple services.
Eventuate Tram provides several messaging abstractions:
-
messaging - send and receive messages over named channels
-
events - publish and consume domain events
-
commands - asynchronously invoke a service by sending a command message and receiving a reply message
The architecture of an Eventuate Tram application
The following diagram shows the architecture of the hhttps://github.com/eventuate-tram/eventuate-tram-examples-customers-and-orders[Eventuate Tram Customers and Orders application]:
The application consists of three services:
-
Customer Service
- implements a REST API for managing customers. The service persists theCustomer
JPA entity in a MySQL/Postgres database. UsingEventuate Tram
, it publishesCustomer
domain events that are consumed by theOrder Service
and theOrder History Service
. -
Order Service
- implements REST API for managing orders. The service persists theOrder
JPA entity in MySQL/Postgres database. UsingEventuate Tram
, it publishesOrder
domain events that are consumed by theCustomer Service
and theOrder History Service
. TheOrder Service
creates orders using a choreography-based saga that consists of events being exchanged between theOrder Service
andCustomer Service
. -
Order History Service
- implements REST API for querying a customer’s order history. This service subscribes to events published by theOrder Service
andCustomer Service
and updates a MongoDB-based CQRS view containing the order history.
The Eventuate Tram CDC service reads messages inserted into the MESSAGE
table using either Transaction log tailing or Polling and publishes them to a message broker, such as Apache Kafka.
About Eventuate Tram Sagas
Eventuate Tram sagas builds on Eventuate Tram to provide orchestration-based sagas. Instead of simply relying on services to respond to domain events, you define a saga orchestrator, which tells the saga participants what operations to execute. To understand the difference between choreography using domain events and orchestration, please read this article and see this presentation.
Learn more
To learn more, please see: