timestampcolumn in the
DomainEventEntrytable 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.
typecolumn in the
DomainEventEntrystores the type identifiers of aggregates. Generally, these are the
'simple name'of the aggregate. Even the infamous
AbstractDependencyInjectionSpringContextTestsin 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
/META-INF/orm.xmlon 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
DomainEventEntrytable uses its own sequence. This can be ensured by specifying a different sequence generator for that entity only.