I am testing out using Javers to help with auditing and creating a changelog for entities that I’m storing in MongoDB in a Spring Boot application. The dataset includes a hierarchy of objects, each stored in their own collections. I bulk import data from files and in turn perform bulk inserts into Mongo using Spring Data Repositories. I have created an example project that replicates the problem on a smaller scale and without javers, I can insert ~200k records into mongo in less than 5 seconds. After simply adding javers 7.6.0
and @JaversSpringDataAuditable
to my repositories, the ~200k insert now takes > 1 min. In my real world data which has a lot more fields, this is causing my bulk import to take hours where it used to take mins.
Are there ways that I can speed up/optimize the work Javers is doing on these inserts? Is there any way to make the Javers operations asynchronous so it’s not blocking the next insert? Any suggestions would be appreciated.