Search code examples
node.jsredishazelcastredislabs

Hazelcast vs Redis(or RedisLabs) for NodeJS application


I have an application having more than 2 TB of data to be stored in cache, the data will be accessed using NodeJS APIs. For a NodeJS app which would be a better choice, Hazelcast or Redis(or RedisLabs)? Considering following criteria?

  • NodeJS API Support, including connection pooling. Looks like HazelCast doesn't have NodeJS API

I understand that in benchmarking Hazelcast is faster due to multithreaded implementation, and its scalable as well. But can we effectively leverage these good features using NodeJS(need Set datastructure)? Lastly, we can have multiple shards in RedisLabs which will be like having multiple threads or processes working on their respective chunk of data, in that case I believe the Hazelcast's edge due to multi-threaded nature would be true for Redis but not for RedisLabs, Any comments in this?


Solution

  • Hazelcast Node.js client in fact does exist and currently provides following features

    • implementation of Open Client Binary Protocol, Redis uses text-based protocol
    • Map
      • Get
      • Put
      • Remove
    • Smart Client - clients connect to each cluster node. Since each data partition uses the well known and consistent hashing algorithm, each client can send an operation to the relevant cluster node, which increases the overall throughput and efficiency. The client doesn't need to be restarted in case of adding or removing nodes from the cluster.
    • Distributed Object Listener
    • Lifecycle Service

    In terms of comparing Hazelcast and Redis server-side features, you find comprehensive doc here.

    Thank you