Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

redis vs hazelcast [closed]

Redis Vs Hazelcast If my app:

  • Have a lot of http requests (6,000 per minute, I collect clicks info) that needs to be saved
  • Have a lot of http requests that query the data previously saved.

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

like image 699
Federico Avatar asked Nov 05 '10 19:11

Federico


People also ask

Is Hazelcast better than Redis?

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.

Is Hazelcast persistent?

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."

Is Hazelcast open source?

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.

What happens if Redis goes down?

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.


2 Answers

We switched from redis to hazelcast for our caching needs.

  • Protostuff + Hazelcast is much faster for us than
  • Protostuff + Jedis (pooled) + Redis

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.

like image 103
psartini Avatar answered Oct 02 '22 13:10

psartini


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

like image 43
Nikita Koksharov Avatar answered Oct 02 '22 13:10

Nikita Koksharov