Stacksaga Event Store

An event store is a log or database designed to store a sequence of state changes (events), rather than just the final state. In stacksaga, you are able to use your primary database as the event-store by providing a separate schema, instead of managing a totally separate system or database for the event-store. it reduces the operational overhead and complexity of managing multiple databases.

In stacksaga you can configure the database for the event-store as the pattern of database per service.

stacksaga diagram event store per service
Even though it is possible to have a single event-store for all services, it is not recommended in production environments due to potential performance bottlenecks and single points of failure and the microservice architecture principles.

What are the reasons for saving the states in the event-store?

  • Reliable Retries

    When an execution fails due to a RetryableExecutorException (such as network issues), StackSaga enables safe retries. In microservice architectures, failures like network errors should not be treated as final exceptions, since transactions often span multiple services, and any service may become temporarily unavailable. By persisting each transaction state in the event store, StackSaga ensures that failed executions can be retried reliably, reducing the risk of data loss or inconsistency.

  • Analysis and Monitoring

    StackSaga provides a dashboard—Stacksaga Trace-Window—for monitoring transaction traces and reviewing errors. All displayed data is sourced from the event store, where transaction records are securely persisted for analysis and troubleshooting.

The event-store is accessed by both StackSaga Database Support modules and as well as the Stacksaga Agent Modules. refer to their respective sections for more details with the use-causes.