MongoDB extenstion. Replay all events and feed it in new Database

Hello. we have our production settings with axon and the MongoDB extension. up and running. our database are at the moment OnPrem. and have to migrate it on atlas mongodb. there we have to encrypt the events with CSFLE.

so for this we have I think to replay our events and save it new with de CSFLE in the database.

so far I know is the CSFLE only possible over the database driver.

or should we make snapshot in axon (we do not need the all history at the moment) but them I think we still have the same problem. but less data maybe;)

You likely want to migrate all the events. I’m not sure in this what would be the easiest way. Something like a small app that can connect to both, and going through all the events, storing them in the new store will probably be easier.

Using snapshots only, makes it impossible to replay all the events, which might be something you need in the future.

1 Like

Is there a way to encrypt the payload of the event. we have the mongodb extension in use?

You could use the data protection module to encrypt some fields. It’s also possible to use a custom event serializer to encrypt the whole payload.

1 Like

Thank is there also a free version :slight_smile: we are not running axon with the axon server we are running it with the MongoDB Extention is it possible with the https://github.com/AxonFramework/extension-mongo

is there maybe a sample out there already for a custom event serializer ?

You can use data protection module without Axon Server. The serializer is basically just a function from bytes to a Java object, and the other way around. There are so many option to do the encryption. All fields, just s few, with the same key, or with different keys. Using the aggregate id to get the encryption key etc.

1 Like