I am planning to use infinispan cache to load all reference/master data needed for my application. I presume I can use the warm cache strategy to pre load the cache with relevant data from the database. Since the master data gets updated through the application , I am planning to having a listener at the application layer which will invalidate the cache entries .
My query is - 1.What is the best way to preload cache data from database ? Is it advisable to trigger the preload process when the application starts up ? Will it slow down the application start up process ? 2.I am planning to define different caches for different groups of reference data .Each cache will have a business key which can be used to fetch the cache data ? Is this is a good approach ? 3.Assume there is a service fetchEmployeeDetails("TOM"). I tried referring the Spring @cacheable annotation. But how it works is that the result of the operation is cached during first invocation and for subsequent invocations , value is fetched from cache.Since I am preoading the cache , I always want to check in cache by default and then in DB. Is there any out of the box solution for achieving such behavior ?