Category: eventuate

Eventuate Local now supports snapshots

Event sourcing persists domain objects as a sequence of (state changing) events. To load a domain object from an event store, an application must load and replay those events. Long-lived domain objects can potentially have a huge number of events, which would make loading them very inefficient.

The solution is to periodically persist a snapshot of the domain object’s state. The application only has to load the most recent snapshot and the events that have occurred since that snapshot was created.

The Eventuate API now supports a snapshot mechanism. To create snapshots for a domain object, you simply define a SnapshotStrategy in the Spring application context. A SnapshotStrategy defines two methods:

  • possiblySnapshot() – invokes when an AggregateRepository updates an aggregate. It can decide to create a snapshot based on, for example, the number of events
  • recreateAggregate() – recreates an aggregate from a saved snapshot

Currently, only Eventuate Local supports snapshots. Eventuate SaaS will support them soon. For more information, see Defining snapshot strategies in Java

 

Introducing the Eventuate Local Console

We are super excited to announce that the Eventuate Local event store now has a simple console. It lets you browse the aggregate types and view aggregate instances. You can also see  a real-time view of the events as they are saved in the event store.

Here is a screenshot showing the TodoAggregate instances:

aggregateinstances

Here is a screenshot showing recent events:

aggregateevents

The UI is implemented using ReactJS UI and a NodeJS-based server. It is packaged as a Docker container image and can be run by defining the following container in your project’s docker-compose.yml:

consoleserver:
 image: eventuateio/eventuateio-local-console:0.12.0
 links:
 - mysql
 - zookeeper
 ports:
 - "8085:8080"
 environment:
 SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
 SPRING_DATASOURCE_USERNAME: mysqluser
 SPRING_DATASOURCE_PASSWORD: mysqlpw
 EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181

Run the Eventuate Todo example application to see it in action.