Redis Rb Cluster

Redis Cluster Ruby client based on redis-rb
Alternatives To Redis Rb Cluster
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Awesome Cheatsheets32,908
8 days ago85mitJavaScript
👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.
Node Redis16,00846,4427,7245 days ago131September 06, 2022192mitTypeScript
A high-performance Node.js Redis client.
Nodebb13,275327 hours ago6December 12, 2016184gpl-3.0JavaScript
Node.js based forum software built for the modern web
Ioredis11,8084,9293,1403 days ago220August 23, 2022212mitTypeScript
🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
Crawlab9,670
9 days ago15August 11, 2020217bsd-3-clauseGo
Distributed web crawler admin platform for spiders management regardless of languages and frameworks. 分布式爬虫管理平台,支持任何语言和框架
Coolify7,326
a day ago236apache-2.0Svelte
An open-source & self-hostable Heroku / Netlify alternative.
Dev Setup5,802
7 months ago34otherPython
macOS development environment setup: Easy-to-understand instructions with automated setup scripts for developer tools like Vim, Sublime Text, Bash, iTerm, Python data analysis, Spark, Hadoop MapReduce, AWS, Heroku, JavaScript web development, Android development, common data stores, and dev-based OS X defaults.
Backendlore4,542
2 years ago
How I write backends
Awesome Programming Books3,649
8 months ago4
📚 经典技术书籍推荐,持续更新...
Bullmq3,5479714 hours ago298September 23, 2022235mitTypeScript
BullMQ - Premium Message Queue for NodeJS based on Redis
Alternatives To Redis Rb Cluster
Select To Compare


Alternative Project Comparisons
Readme

Redis-rb-cluster

Redis Cluster client work in progress. It wraps Redis-rb, and eventually should be part of it.

For now the goal is to write a simple (but not too simple) client that works as a reference implementation, and can be used in order to further develop and test Redis Cluster, that is a work in progress itself.

Creating a new instance

In order to create a new Redis Cluster instance use:

startup_nodes = [
    {:host => "127.0.0.1", :port => 6379},
    {:host => "127.0.0.1", :port => 6380}
]
max_cached_connections = 2
rc = RedisCluster.new(startup_nodes,max_cached_connections)

The startup nodes are a list of addresses of Cluster Nodes, for the client to work it is important that at least one address works. Startup nodes are used in order to:

  • Initialize the hash slot -> node cache, using the CLUSTER NODES command.
  • To contact a random node every time we are not able to talk with the right node currently cached for the specified hash slot we are interested in, in the context of the current request.

The list of nodes provided by the user will be extended once the client will be able to retrieve the cluster configuration.

The second parameter in the object initialization is the maximum number of connections that the client is allowed to cache. Ideally this should be at least equal to the number of nodes you have, in order to avoid closing and reopening TCP sockets. However if you have very large cluster and want to optimize for clients resource saving, it is possible to use a smaller value.

Sending commands

Sending commands is very similar to redis-rb:

rc.get("foo")

Currently only a subset of commands are implemented (and in general multi-keys commands are not supported by Redis Cluster), because for every supported command we need a function able to identify the key among the arguments.

Disclaimer

Redis Cluster is released as stable. This client is a work in progress that might not be suitable to be used in production environments.

Popular Redis Projects
Popular Nodejs Projects
Popular Data Storage Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Ruby
Node
Redis
Progress
Redis Cluster