Redis Cluster Client for Erlang

Redis


Redis (Remote Dictionary Service) is an open source NoSQL database server which is licensed under BSD-license. Redis is an advanced key-value store and considered as a data structure server since keys can contain many of the foundational data types such as Strings, Lists, Sets, Sorted Sets, and Hashes. Redis works with an in-memory data set in order to reduce the overhead in accessing the non-volatile memory and thus supposed to keep the entire key space in memory during operations. When terminated
data will be purged from memory. But depending on the use case, data can be persisted either by taking a snapshot of the data and dumping it on disk periodically or by maintaining an append-only log of all operations.

Redis is supporting advanced features like Sorted Sets, and many other complex atomic operations since it is in memory, and single threaded. Redis does not use the Operating System-supplied Virtual Memory facilities and instead implements its own system called Redis Virtual Memory.
The goal of Redis Virtual Memory (VM) is to swap infrequently-accessed data from RAM to disk, without drastically changing the performance characteristics of the database while supporting data sets that are larger than main memory. 



For production applications, replicating the data across multiple nodes is mandatory task and redundancy allows for recovery in case of environment failure. Since the Redis is heavily used in concurrent applications because of its performance, load distribution across multiple nodes is also an important point.  With previous versions of the Redis DB, replication and data distribution over multiple nodes are handled within the application itself as described in the below diagram.






Redis Clustering


With the Redis version 3.0, Redis introduced Redis Clustering, which reduces an application headache in Redis node management by letting the application to query required data.


Please refer the Redis official document for clustering and the following image provides an abstract view of the cluster concept.


Erlang Redis Cluster Client - eredis_cluster_client


The eredis_cluster_client is an enhanced version of eredis_cluster an  Erlang wrapper for eredis client which provides the ability to connect multiple clusters initiating a single eredis_cluster_client instance.
The eredis_cluster client only facilitates to access a single cluster within your application, while eredis_cluster_client implemented on the top of eredis_cluster to address this issue. 



To connect multiple Redis clusters in your application, you need to start the eredis_cluster_pool supervisor, and multiple eredis_cluster_client s in your application supervisor as,




Available functions.



eredis_cluster_client Git Repo : https://github.com/Tiroshan/eredis_cluster_client 

No comments:

Post a Comment