The Eventuate Tram framework enables a Java/Spring application to send messages as part of an database transaction. This enables an application atomically update state and send a message or a domain event. It is a foundation of maintaining data consistency within a microservice architecture.
Eventuate Tram is a framework developing asynchronous microservices that use the the traditional JDBC/JPA-based persistence model. Unlike event sourcing, adding Eventuate Tram to your Spring/Sprint Boot application requires minimal changes.
Eventuate Tram provides several messaging abstractions:
The following diagram shows the architecture of the Eventuate Tram Todo application:
The application consists of two services:
Todo Service - implements the REST endpoints for creating, updating and deleting todos.
The service persists the Todo JPA entity in MySQL.
Eventuate Tram, it publishes Todo domain events that are consumed by the
Todo View Service.
Todo View Service - implements a REST endpoint for querying the todos.
It maintains a CQRS view of the todos in ElasticSearch.
Todo Service publishes events using Eventuate Tram.
Eventuate Tram inserts events into the
MESSAGE table as part of the ACID transaction that updates the TODO table.
The Eventuate Tram CDC service tracks inserts into the
MESSAGE table using the MySQL binlog and publishes messages to Apache Kafka.
Todo View Service subscribes to the events and updates ElasticSearch.
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 see this presentation.
To learn more, please see: