Ehcache is cached directly in the JVM virtual machine, fast and efficient, but the cache sharing is troublesome, the cluster distributed application is inconvenient.
Redis is accessed through the socket to the cache service, the efficiency is lower than ecache, much faster than the database, processing clusters and distributed cache convenient, has a mature program.
If it is a single application or a high-demand application for cache access, use Ehcache.
Redis is recommended for large systems where cache sharing, distributed deployment, and cache content are large.
Add: Ehcache also has a cache sharing scheme, but through RMI or Jgroup multicast mode for broadcast cache notification update, cache sharing complex, maintenance inconvenient; simple sharing can, but involves cache recovery, big data cache, is not appropriate.
Comparison and application scenario analysis of Ehcache and Redis (RPM)