EventStorageEngine
implementation:DomainEventEntry
, columns aggregateIdentifier
and sequenceNumber
(unique index)DomainEventEntry
, eventIdentifier
(unique index)SnapshotEventEntry
, aggregateIdentifier
column.SnapshotEventEntry
, eventIdentifier
(unique index)AssociationValueEntry
, columns sagaType
, associationKey
and associationValue
,AssociationValueEntry
, columns sagaId
and sagaType
,timestamp
column in the DomainEventEntry
table only stores ISO 8601 timestamps. If all times are stored in the UTC timezone, they need a column length of 24 characters. If you use another timezone, this may be up to 28. Using variable length columns is generally not necessary, since time stamps always have the same length.WarningIt is highly recommended to store all timestamps in UTC format. In countries with daylight saving time, storing timestamps in local time may result in sorting errors for events generated around and during the timezone switch. This does not occur when UTC is used. Some servers are configured to always use UTC. Alternatively, you should configure the event store to convert timestamps to UTC before storing them.
type
column in the DomainEventEntry
stores the type identifiers of aggregates. Generally, these are the 'simple name'
of the aggregate. Even the infamous AbstractDependencyInjectionSpringContextTests
in Spring only counts 45 characters. Here, again, a shorter (but variable) length field should suffice.JpaEventStorageEngine
, Axon relies on the JPA implementation to create the table structure. While this will work, it is unlikely to provide the configuration that has the best performance for the database engine in use. That is because Axon uses default settings for the @GeneratedValue
annotation./META-INF/orm.xml
on the classpath, which looks as follows:metadata-complete="false"
. This indicates this file should be used to override existing annotations, instead of replacing them. For the best results, ensure that the DomainEventEntry
table uses its own sequence. This can be ensured by specifying a different sequence generator for that entity only.