{"id":19190823,"url":"https://github.com/tinder/sharded-redis-client","last_synced_at":"2025-05-08T04:51:20.342Z","repository":{"id":25770136,"uuid":"29208394","full_name":"Tinder/sharded-redis-client","owner":"Tinder","description":"Sharded Redis Client for Node.js","archived":false,"fork":false,"pushed_at":"2023-04-16T01:26:13.000Z","size":80,"stargazers_count":4,"open_issues_count":8,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T08:38:20.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tinder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-13T20:02:43.000Z","updated_at":"2024-03-24T11:16:56.000Z","dependencies_parsed_at":"2024-11-09T11:35:58.912Z","dependency_job_id":null,"html_url":"https://github.com/Tinder/sharded-redis-client","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinder%2Fsharded-redis-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinder%2Fsharded-redis-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinder%2Fsharded-redis-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinder%2Fsharded-redis-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tinder","download_url":"https://codeload.github.com/Tinder/sharded-redis-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253002841,"owners_count":21838637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T11:35:53.072Z","updated_at":"2025-05-08T04:51:20.333Z","avatar_url":"https://github.com/Tinder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sharded Redis Client\n\n## Description\n\nCreates a Redis client that consistently shards by key using sha1\n\n## Usage\n\n### Example 1:\n```\nconst shardedClient = new ShardedRedisClient([{\n  host: 'box1.redis',\n  port_range: [6370, 6372]\n}, {\n  host: 'box2.redis',\n  port_range: [10000]\n}, {\n  host: 'box3.redis',\n  port_range: [6379, 6380],\n  slaveHosts: ['box3.redis.slave1', 'box3.redis.slave2'],\n  readPreference: 'slave' // \u003c- force read slave on this set\n}]);\n```\n\nRepresents a 6-client sha1 HashRing in the following order:\n```\n[\n 'box1.redis:6370',\n 'box1.redis:6371',\n 'box1.redis:6372',\n 'box2.redis:10000',\n 'box3.redis:6379', // slaves: 'box3.redis.slave1:6379', 'box3.redis.slave2:6379'\n 'box3.redis:6380', // slaves: 'box3.redis.slave1:6380', 'box3.redis.slave2:6380'\n]\n```\n\n### Example 2 (single client):\n```\nconst shardedClient = new ShardedRedisClient([{ host: 'localhost', port_range: [3000] }])\n```\n\nRepresents a 1-client (unsharded) HashRing that is only useful in development: `['localhost:3000']`\n\nUse with slaves: `shardedClient.slaveOk()`\n\nIf a slave doesn't exist for a given client, nothing changes.\nAlso, `slaveOk()` only affects read-only commands.\n\n## Contributing\n\nPull requests are welcome, please open an issue first.\n\n## Tests\n\nRun tests using...\n\n```\n$ npm test\n```\n\n## Copyright\n\nCopyright © 2013 - 2017 Tinder, Inc.\n\nPermission to use, copy, modify, and distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinder%2Fsharded-redis-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinder%2Fsharded-redis-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinder%2Fsharded-redis-client/lists"}