0

We got multiple Application Server behind a Reverse Proxy. We want a single cache on another host which all Application Servers can easily use, thus the cache has to have some kind of network support. Furthermore the setup should be easy probably supporting docker, but this is not a must. The cache duration is about 1d. The API should be as easy and standardized as possible (JCache?). In a later stage we want to prepolutate the Cache.

Which options do I have?

Background: In a first step we want to reduce load on the backend systems, which provides mainly SOAP Services. So we want to cache the SOAP response (JAX-WS). The cache hit rate will be probably about 25% in a first stage. Later we want to use the same cache for JPA as well (we already have in memory caching enabled for each Application Servcer and use a Cache Coordination strategy). To use even more caching we will need some sort cache categories.

Neil Stockton
  • 11,383
  • 3
  • 34
  • 29
Christian
  • 3,503
  • 1
  • 26
  • 47
  • Have you tried memcached? It just runs a cache server at specific port and you can call it from all your application servers. It has a nice java apis too. – Veselin Davidov May 19 '15 at 08:55
  • check this site: http://www.javaworld.com/article/2078565/open-source-tools/use-memcached-for-java-enterprise-performance--part-1--architecture-and-setup.html – Veselin Davidov May 19 '15 at 08:55
  • They use spymemcached as a client, which is a bit of a lock in. We want to be open regarding the client. But it would be a viable option. – Christian May 19 '15 at 09:03
  • yeah in the example they use that client but in a project we didn't use that. it's an open source solution, the protocol is open source you are not forced to use any already made client. I was pointing to the architecture in the link. In my experience it works great in a working environment even in a site with millions of users. – Veselin Davidov May 19 '15 at 10:04

2 Answers2

1

In general: The question is to broad and actually you are asking for a product recommendation. Please take a look at the stackoverflow question guidelines.

About your question:

There is no "single cache" for any purpose. Furthermore, there can be many variants in software and system architecture, with a single cache product, too. The best solution depends not on the application but on the type of data access you want to cache. Some questions that come to my mind:

Do you have a mostly read or a read/write usage pattern? What is the type of access, point, range, or a full scan? What type of operations you do on the data? What is the object count and typical object size? Are there hot spots? How many application servers you have? Is there a memory limit in the application servers? How costly is it to generate the data in the backend (latency and resource costs)?

One general recommendation: If you only have a few application servers, I would start with local caching in the application servers and ignore the fact that there may be redundant requests on the backend from different application servers. This way you can keep the existing system architecture. Putting in a separate cache server or servers needs a lot of planing and a lot considerations for staging, deployment and operation your application.

One second general recommendation: The cache hit rate will be probably about 25% in a first stage A cache with this hitrate will be pretty useless. It may happen that you don't get any performance gain from the cache at all. There may be reasons to do it anyway, e.g. to improve the application for flash crowds. This needs some more detailed elaboration. Double check you numbers!

I am looking forward for more detailed questions :)

cruftex
  • 5,545
  • 2
  • 20
  • 36
  • Thx for the answer. Using a local cache for each instance will be probably best in a first go. 25% is pretty useless at first sight, but in a second stage we want to prepopulate that cache nightly and get to a hit rate probably near 90%+. 25% are at least helping power users querying a lot the same (expensive) data over and over again. We are going now for a JCache Implementation, probably Infinispan, which gives us many options regarding infrastructure. 2nd it will help to reduce code complexity grown in years, because some objects are already cached in hashmaps in different places. – Christian Jun 01 '15 at 10:13
0

What about using the cache server from Ehcache ? It provides a RESTful interface and can run on a dedicated server.

hertzi
  • 2,809
  • 2
  • 14
  • 13