history graph tracking with GIT-like branching


In Axon, the event repository is organized as a simple linear path. I would like to get it organized as GIT-like graph in order to test hypothesis, or to undertake local projects before integrating them to the main work flow. Branches management shall be able to cope with branching, merging, rebasing along with additional business integrity controls for state validation. In order to reconstruct a particular state of the business objects, the event path from the origin to the current state in this graph shall be followed. While commiting a particular branch into another, the resulting merge node shall be created and checked upon business coherence rules.
Is there an elegant way to get this done with Axon as it is ?
Thank you for your answers.

Alain Touret

Hello Alain,

Axon has not been designed to work with this usecase. Instead, Axon favours consistency on the command model. We have had various discussions in the past about these kinds of usecases. Each time, the conclusion was that there are so many pitfalls in this approach, that it requires a different type of framework to deal with it. Perhaps using Git itself isn’t even that bad of a idea.

On the other hand, depending on your exact needs, Axon might do the job for you. Axon only expects a unique aggregateIdentifier and sequenceNumber combination in the event store, but if you identify events in another way (e.g. branch name), then you can probably remove the uniqueness restriction from the event store. In the Meta-Data, you’d have to refer to the event ID of the “base” the changes were made on. That would allow you to recreate the graph. The sequence number would then just server to efficiently query the events in the right order.

Kind regards,

Allard Buijze

Thank you Allard, I am glad to read your diagnosis. I will investigate this track.

Alain Touret