Use EmbeddedEventStore or subclass from AbstractEventStore?

My question is around EmbeddedEventStore. The performance off it and how best to optimise it, along with, should I be using it at all?

I’m using EventSourcingRepository, EmbeddedEventStore & a Cassandra Engine.

I tried extending ‘AbstractEventStore’ but ran into issues, not understanding the framework correctly to be honest.

I worry when you see the word ‘embedded’. Should I be rolling my own implementation or using this one?

How best should it be tweaked. I couldn’t find a good solid, straight-forward extension of AbstractEventStore.

Thanks,
Gerry.

Hi Gerard,

Yes, you should use the EmbeddedEventStore. It is initialized with an EventStorageEngine, which has several implementations for different storage backends. You could have a look at those implementations to get some inspiration how to implement one for Cassandra.

Hope this helps, Oscar

Ive got the Engine developed in Cassandra but I wondered how performant EmbeddedEventStore actually is and how best to tune it.

AbstractEventStore might be cleaner?

Thanks,

Hi Gerard,

the key for the performance is not in the EmbeddedEventStore, but rather in the EventStorageEngine that it is using. The EmbeddedEventStore uses the Event Storage Engine to perform the actual storage of events, to ensure they can be accessed on other machines.
The EmbeddedEventStore will manage the streams from consumers, combining them into a single stream when multiple consumers are reading the same events. This is to optimize I/O in the case many consumers are reading from the HEAD of the Event Store.

If you really care about performance, I’d reconsider Cassandra first. While Cassandra can append data very fast, you pay a massive performance penalty if you want to perform duplicate key checks. We have seen very good results in a properly tuned RDBMS, and of course in AxonIQ’s Event Store Server.

Generally, you don’t need to tune the EmbeddedEventStore much. It’s mainly the StorageEngine that needs tuning. One thing that can be tuned in the EmbeddedEventStore is the delay between two “polls” to the EventStorageEngine to check for data that has been appended to the event store by another instance (data inserted locally will trigger an immediate poll).

Hope this helps.
Cheers,

Allard