Micronaut Hibernate JPA MariaDB - saveAll 20K data High CPU usage

35 views Asked by At

I am using Micronaut Hibernate JPA, and MariaDB as database in my project. I use JPA repositories for database transactions. I receive lots of data (20K-100K) each second and I need to save them to a table. I use saveAll method in CrudRepository interface. But when I save the data CPU overhead increases a lot. I made a research and I think if I use second level cache, it can help decrease the CPU overhead.

  1. What should do to enable and use second level cache?
  2. I think there is "ehcache". What would be the yml configuration file and
  3. What would be the additional dependencies that I can add to my Maven pom file?
0

There are 0 answers