hazelcast vs ehcache

We tried both of them for one of the largest online classifieds and e-commerce platform. We started with ehcache/terracotta(server array) cause it's well-known, backed by Terracotta and has bigger community support than hazelcast.
When we get it on production environment(distributed,beyond one node cluster) things changed, our backend architecture became really expensive so we decided to give hazelcast a chance.

Hazelcast is dead simple, it does what it says and performs really well without any configuration overhead.

Our caching layer is on top of hazelcast for more than a year, we are quite pleased with it.


Even though Ehcache has been popular among Java systems, I find it less flexible than other caching solutions. I played around with Hazelcast and yes it did the job, it was easy to get running etc and it is newer than Ehcache. I can say that Ehcache has much more features than Hazelcast, is more mature, and has big support behind it.

There are several other good cache solutions as well, with all different properties and solutions such as good old Memcache, Membase (now CouchBase), Redis, AppFabric, even several NoSQL solutions which provides key value stores with or without persistence. They all have different characteristics in the sense they implement CAP theorem, or BASE theorem along with transactions.

You should care more about, which one have the functionality you want in your application, again, you should consider CAP theorem or BASE theorem for your application.

This test was done very recently with Cassandra on the cloud by Netflix. They reached to million writes per second with about 300 instances. Cassandra is not a memory cache but you data model is like a cache, which is consist of key value pairs. You can as well use Cassandra as a distributed memory cache.


Hazelcast has been a nightmare to scale and stability is still a major issue.

The dedicated client to grid component choices are

  1. The messy version that cant survive node loss anywhere, negating the point of backups (superclient), or
  2. An incredibly slow native client option that does not allow for any type of load balancing to processing nodes in the grid.

If any host could request records from this data grid it would be a sweet design, but you are stuck with those two lackluster option to get anything out of it.

Also multiple issues with database thread pools locking up on individual members and not writing anything to the databases, causing permanent records loss is a frequent issue and we often have to take the whole thing down for hours to refresh any of the JVM's. Split brain is also still an issue, although in 1.9.6 it seems to have calmed down a little.

Rallying to move to Ehcache and improving the database layer instead of using this as a band-aid.