redis vs hazelcast [closed]
Asked Answered
C

5

41

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

Colloquial answered 5/11, 2010 at 19:34 Comment(3)
You should try describing better your problem. The data you want to put inside, and especially, the way you need to query your data.Eastern
I'm planing to put around 30 M key-values. Data looks like. userid-Set . set has attributes for that user,around 10. It will get updated constantly and it will get query constantly. I like redis because it knows what a Set is and it's one operation, but it cannot scale.Colloquial
Almost a decade later, 6000 req/min is very commonplace, hardly "a lot".Bramlett
S
31

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.

Shirleenshirlene answered 18/6, 2011 at 20:22 Comment(2)
Now Hazelcast has many official clients in .Net, Java, C++, NodeJS, Python, Go and Scala that are listed hereEdulcorate
While, no body says that Hazelcast coupled you business application and data storage, which means you need synchronize whole memory data everytime when you restart you whole cluster willingly or not. This could be horrible actually.Tarsier
M
18

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

Menken answered 12/1, 2014 at 15:32 Comment(1)
With All due respect you are the Author of redisson, so please tell that clearly in the Answer.Doublecross
E
15

As of 2017, both Redis and Hazelcast offer highly available\scalable key\value storage. With very fast response times < 10ms.

Redis is unique in that it supports other data structures like sored sets, hash sets and a pub\sub mechanism. It's also extensible via lua scripting. It is probably the most popular and widely used of the two products. Especially outside of the Java ecosystem.

Hazelcast is unique in that it can be embedded in a Java host process, making it great for building stateful microservices without an external database dependency. It also has some other small differences, like the ability to get a call back from a key expiration. In a sense, it does less overall but the few things it does, it does them better. Especially if you're using Java.

Overall these are similar solutions designed for similar use cases like caching external data, creating a communication backplane or shared memory state for a stateful microservice, or possibly even storing (small amounts of non-relational) business data with some degree of durability.

Encamp answered 23/5, 2014 at 3:17 Comment(3)
Don't agree with your opinion. Redis scale configuration doesn't took a lot of time it took an hour or so. You don't need Twemproxy too, if you use Redisson, for example. It resolves any connection balancing issues for you.Menken
I agree that with the RC of Redis cluster and new SaaS managed services for Redis the landscape has changed in terms of scaling Redis to multiple horizontally load balanced instances since I wrote this.Encamp
@Eric Then please edit or delete your answer.Olmos
C
1

Both Redis and Hazelcast are memory based databases, so in theory, they should provided the same speed and performance. Looking over the docs for Hazelcast, you will get better support with Redis because of the wide amount of Libraries for interfacing with the database. Hazelcast looks like they only have java libs, Redis has one for every language.

Answers:

  1. You will have to test this on your own, as far as I can tell different comparisons shows Redis as faster one of them is here, but i won't say these benchmarks are 100%

  2. They should be both reliable, but I can not vouch for Hazelcast.

  3. Maybe...

I would go with Redis, because I find it is the most usable and it has great documentation.

Crud answered 8/11, 2010 at 18:8 Comment(1)
That benchmark compares Redis to memcached, not Hazelcast.Spiceberry
L
1

To decide which one is the good, there is an issue about the client-thread using.

According to this benchmark Hazelcast is better than Redis if you use more thread. Maybe this is an unfair company benchmark but shows something about threading.

Lynnelynnea answered 11/11, 2016 at 7:38 Comment(3)
I'd be grateful for any feedback or criticism that I can learn from or use to help me improve my answer. So please leave a comment while downvoting an answer...Lynnelynnea
I wouldn't trust such benchmark. First, it doesn't provide any information about Redis cluster, such major part as master/slave nodes amount it consist of. For example, Redis cluster write operations scale depends on master nodes amount same for read operations. Here is another benchmark which shows 1.2M ops/sec for Redis cluster highscalability.com/blog/2014/8/27/…Menken
I think you mostly got downvoted because people are looking for independent and neutral evaluation of different products, and you just linked Hazelcast's own blog, which, even if they tried to be neutral, is still likely to be biased, because they will create a test which suits their product. Also, stackoverflow prefer you to quote the relevant information as well as providing a link, in case the link stops working.Finedrawn

© 2022 - 2024 — McMap. All rights reserved.