node-redlock icon indicating copy to clipboard operation
node-redlock copied to clipboard

Is this repository still being maintained?

Open christian-gama opened this issue 1 year ago • 12 comments

I wonder if this repository still actively maintained. I noticed last change happened more than 1 year ago and latest version is still 5.0.0-beta.2 since then.

Type definition for version 5 is missing as well.

If this is no longer maintained, is there an active repository for redlock implementation?

christian-gama avatar Oct 31 '24 23:10 christian-gama

If you're using pnpm or yarn you can patch to get the typings to work (see my comment here). Hoping the maintainers haven't abandoned this project 🤞.

rdadoune avatar Nov 08 '24 22:11 rdadoune

@mike-marcacci Would it be possible to release a patched version?

punkpeye avatar Nov 29 '24 18:11 punkpeye

FWIW, on a project I contribute to, we are switching to this implementation: https://github.com/sesamecare/redlock

ckane avatar Dec 05 '24 22:12 ckane

If you're using pnpm or yarn you can patch to get the typings to work (see my comment here). Hoping the maintainers haven't abandoned this project 🤞.

can this be used without 'ioredis' ?

abdullah230695 avatar Dec 06 '24 16:12 abdullah230695

FWIW, on a project I contribute to, we are switching to this implementation: https://github.com/sesamecare/redlock

Appreciate you sharing this!

punkpeye avatar Dec 06 '24 19:12 punkpeye

FWIW, on a project I contribute to, we are switching to this implementation: https://github.com/sesamecare/redlock

Appreciate you sharing this!

Anything for my fellow travelers

ckane avatar Dec 06 '24 19:12 ckane

I get some bad experiences while using this library, so I did some work, https://smilecc.github.io/node-redisson/

If anyone is willing to use it, it would be my honor.

smilecc avatar Dec 16 '24 11:12 smilecc

What's the bad experience and what did you change?

I've been using it with no issues.

punkpeye avatar Dec 16 '24 13:12 punkpeye

From The GitHub Page:

Why Node Redisson

Usually, Node.js developers will use Node Redlock as a distributed lock, but it seems that this project is no longer maintained.

Moreover, node-redlock project is not very easy to use. When using it, you need to pay great attention to the holding time of the lock, make predictions about the holding time of the lock in advance, and manually renew the lock. However, in actual business development, it is very difficult to make efficient predictions about the holding time of the lock.

Node Redisson has implemented the watchdog and unlock notification features, so that you don't have to worry about predicting the holding time of the lock anymore.

Of course, you can also manually set the duration of the lock.

ckane avatar Dec 16 '24 14:12 ckane

What's the bad experience and what did you change?

I've been using it with no issues.

First of all, I want to say that different solutions have different pros and cons, and I don't want to argue about this.

Let me talk about some of the shortcomings of the Redlock solution that I know of.

  1. Redlock relies on N+1 nodes of Redis. When you use 3 or 5 nodes, it does cost more machines and operation costs.

  2. Redlock uses voting to determine the ownership of the lock, which is very dependent on the clock consistency of multiple nodes. but the clock may jump. For example, we know that there are leap seconds in this world.

  3. I roughly read the code of this repository. In redlock, since time is very important, in the article of antirez (the proposer of redlock), it is very important to judge the time consumed after acquiring the lock, but I don't seem to find such code.

How can ZooKeeper's lock avoid similar problems? In ZooKeeper, there is no need to consider the expiration time of the lock. It uses temporary nodes and uses the client heartbeat to ensure that the client can hold the lock after getting the lock until the lock is released or the connection is disconnected.

But I still want to use Redis, so Redisson implements a similar mechanism on the client side to realize the heartbeat of the lock.

That's all I want to say and what I do. If there are any errors, please point them out. Thank you.

smilecc avatar Dec 16 '24 16:12 smilecc

FWIW, on a project I contribute to, we are switching to this implementation: https://github.com/sesamecare/redlock

This appears to be a great drop in replacement

FabianFrank avatar Mar 26 '25 22:03 FabianFrank

FWIW, I've been using redlock-universal as an alternative. It handles both node-redis and ioredis, and has auto-extension built in which saves a lot of headache with long-running tasks.

  await lock.using(async (signal) => {
    await longRunningOperation();
  });

https://www.npmjs.com/package/redlock-universal

(Disclosure: I wrote it, but only mentioning because the thread is asking about alternatives)

alexpota avatar Oct 30 '25 17:10 alexpota