Redis Vs Hazelcast If my app:
My Questions are - Which one between Redis and Hazelcast should I chose to store and query data - which one is faster for reads and writes? - which one is more reliable? - Might Cassandra be a better option?
Answering any of the questions helps
Repeatable benchmarks show that Hazelcast is many times faster. Redis is single-threaded, so it does not efficiently scale for larger loads, while Hazelcast performance scales linearly with additional resources. Hazelcast is easy to use, and it can be embedded in apps or deployed in a client-server model.
Hazelcast doesnt allow persistence to File. Quote from the documentation " NOTE: Data store needs to be a centralized system that is accessible from all Hazelcast members. Persistence to a local file system is not supported."
In-Memory Computing Hazelcast is an open-source distributed In-memory object store supporting a wide variety of data structures such as Map, Set, List, MultiMap, RingBuffer, HyperLogLog. Cloud and Kubernetes friendly.
When Redis goes down, you have to deal with it. It is the same as if your file system is gone or your SQL Server is down. A lot of those systems disable all writes and set their cluster in maintenance state.
We switched from redis to hazelcast for our caching needs.
We use protostuff to serialize beans that are expensive to create. Hazelcasts standard-serialization mechanism is much slower. Our environment is Glassfish 3.1.
Hazelcast looks like they only have java libs, Redis has one for every language.
True. Hazelcast provides just a REST API and an implementation of the memcached protocol.
There is a very handy lib - Redisson. It provides distributed Java objects and services (BitSet
, BloomFilter
, Set
, SortedSet
, Map
, ConcurrentMap
, List
, Queue
, Deque
, BlockingQueue
, BlockingDeque
, ReadWriteLock
, Semaphore
, Lock
, AtomicLong
, CountDownLatch
, Publish / Subscribe
, RemoteService
, ExecutorService
, LiveObjectService
, ScheduledExecutorService
) on top of Redis server!
It supports cluster, sentinel, master/slave and single connection modes.
Perfectly works in cloud and supports AWS Elasticache and Azure Redis Cloud
Below are some success stories from Redisson customers:
Moving from Hazelcast to Redis
Distributed Locking with Redis (Migration from Hazelcast)
Please note: I'm an author of Redisson
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With