Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robertobandini/node-redis-example-5
A Redlock example with Node.js about how to lock a key pair on Redis
https://github.com/robertobandini/node-redis-example-5
Last synced: 18 days ago
JSON representation
A Redlock example with Node.js about how to lock a key pair on Redis
- Host: GitHub
- URL: https://github.com/robertobandini/node-redis-example-5
- Owner: robertobandini
- Created: 2020-11-29T18:05:51.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-29T18:09:15.000Z (about 4 years ago)
- Last Synced: 2024-11-17T20:49:02.488Z (about 2 months ago)
- Language: JavaScript
- Size: 37.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-redis-example-5
A Redlock example with Node.js about how to lock a key pair on Redis
In the previous example https://www.robertobandini.it/2020/11/22/testing-redis-high-concurrency-with-apachebench/ we’ve tested with ApacheBench an application deployed using Kubernetes and Docker, composed by a Node.js microservice to get and set key value pairs on Redis.
We saw that if we have many concurrent requests from multiple clients we can’t know before which will be the final value of the key on Redis.In this example we see an example about how we can lock a key value pair on Redis, so that another client has to wait before to set a new value.
We will use the Node.js implementation of Redlock, the algorithm to have distributed locks with Redis.You can find any information on this post: https://www.robertobandini.it/2020/11/29/a-redlock-example-with-node-js-about-how-to-lock-a-key-pair-on-redis/