Simple question about AxonDB

Hi,

I just replaced our MongoDB based event/saga store by the developer edition of AxonDB. It took me about 15 mins to setup all of this :wink:

One thing is not completely clear to me, and that this:

For the MongoDB setup, I created a MongoTokenStore, MongoStorageEngine, MongoSagaStore and EventHandlingConfiguration to allow storing events, tracking tokens and sagas.

All I did for AxonDB was what was in the documentation which is just define these two beans:

`

@Bean
public AxonDBConfiguration axonDBConfiguration() {
return new AxonDBConfiguration();
}

@Bean(name = ā€œeventBusā€)
public EventStore eventStore(AxonDBConfiguration axonDBConfiguration,
Serializer serializer) {
return new AxonDBEventStore(axonDBConfiguration, serializer);
}

`

Is this really enough? I want to keep using tracking event listeners, persist my sagas (and not use an in mem store).
And is there any way to query for sagas?

Thanks,

Danny

Hi Danny,

Good question, maybe we should actually explain this in the manual.

AxonDB is designed to be really good at being an event store. It can append events and snapshots to its storage, and allows you to read these back, either per-aggregate (for event sourced repositories) or as a whole (for tracking event processors). It does this particular job extremely well, in a fast and scalable way, but it is all it does. Storing tracking tokens (that contain the positions of individual tracking event processors in the event stream) and saga state (which, unlike events, is mutable rather than append-only) is outside of the scope of AxonDB, so you would still need a separate solution for this, in your case MongoDB.

Specifically, this means the following for your setup:

  • You donā€™t need the MongoEventStorageEngine anymore. The only reason for having that is to instantiate the EmbeddedEventStore implementation of the EventStore interface around this. This is now replaced by the AxonDBEventStore, as events and snapshots are in AxonDB.
  • You will still need the MongoTokenStore to store tracking tokens.
  • You will still need the MongoSagaStore to store sagas.
  • The EventHandlingConfiguration is something you would have anyway, but can be used to modify event processing configuration in Java code. AxonDB itself only supports tracking event processors, so a pretty typical config would be like:
    @Autowired
    public void config(EventHandlingConfig config) {
    config.usingTrackingProcessors()
    }
    (Of course, if you for some reason need to mix tracking and subscribing processors, thatā€™s possible as well, but you would be setting up a secondary event bus.)
    Kind regards,

Hi Frans,

It's clear now, so thanks.

Regards,

Danny