Question

We're trying to horizontally scale a JPA based application, but have encountered issues with the second level cache of JPA. We've looked at several solutions (EhCache, Terracotta, Hazelcast) but couldn't seem to find the right solution. Basically what we want to achieve is to have multiple application servers all pointing to a single cache server that serves as the JPA's second level cache.

From a non java perspective, it would look like several PHP servers all pointing to one centralised memcache server as it's cache service. Is this currently possible with Java?

Thanks

Was it helpful?

Solution

This is in response to the comment above.

  1. Terracotta will be deployed in it's own server
  2. Each of the app server will have terracota drivers which will store/retrieve data to-fro terracotta server.
  3. Ehcache api present in the application war, will invoke the terracota drivers to store data into terracotta server.
  4. Hibernate api will maintain the L1 cache, in addition it will use the ehcache api to save/retrieve data to-fro L2 cache. Blissfully unaware about how ehcache api performs the task.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top