We’re currently looking into using MySQL partitioning with our event store to be able to more easily manage the ever growing amounts of data. The change we’re looking to introduce is to add a new artificial primary key consisting of an auto_increment and a timestamp (MySQL timestamp instead of the Axon default varchar) and then do range partitioning on the timestamp.
One caveat is that when you employ partitioning, all unique indexes have to contain the partitioning key which means the natural key for domain events, (
sequenceNumber) can no longer be created as a unique index. Given that all inserts for a particular aggregate type only happens from a single JVM and using an EventSourcingRepository (which is a LockingRepository), what problems do you see with scrapping the unique constraint on the natural key index?