How to Use MongoDB as Event Store in Axon 4.0

There are quite a number of example on using MongoDB as event store in Axon Framework 3.x. However, I cannot find an example for using MongoDB as event store in Axon 4.0. Can anybody share with me a simple example? Thanks.

Hello Polly,
I don’t have an answer for you since it sounds like maybe the setup has changed. However, Allard has essentially said that it’s better to use a relational database for an event store.

“in practice, we have seen by far the best results using a relational database as an Event Store (besides our own Event Store Server, obviously). Mongo is nice, but doesn’t really fit nicely with Tracking Processors, for one. It will work, but isn’t efficient. Furthermore, the lack of (cross document) transactions, makes it awkward to use, at times.”

I just created one sample/demo with MongoDB as an event storage:

Please, consider using relational database or Axon Server as an Event Store. They perform better.

Thanks for your example and suggestion. I will consider to use MySQL.