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.
- What should do to enable and use second level cache?
- I think there is "ehcache". What would be the yml configuration file and
- What would be the additional dependencies that I can add to my Maven pom file?