How to increase bulk insert performance when using Javers to audit changes
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.