madelson / DistributedLock

A .NET library for distributed synchronization
MIT License
1.75k stars 182 forks source link

RavenDB implementation #127

Open adambajguz opened 2 years ago

adambajguz commented 2 years ago

Hi @madelson, do you have any plans for adding RavenDB distributed lock implementation?

madelson commented 2 years ago

@adambajguz this is the first request I've seen for RavenDB. Do you have any thoughts/links for RavenDB locking?

In general I'm open to adding/accepting support for any technology where there is demand and a reasonable path to implementation.

adambajguz commented 2 years ago

https://youtu.be/agGQoD8c1Yo (minutes 38-49)

https://ravendb.net/articles/pessimistic-locking-ravendb

https://github.com/ravendb/book/blob/v5.0/Ch04/Ch04.md

https://github.com/danfma/Fluidity.Raven.Lock/tree/develop/Fluidity.Raven.Lock

https://elemarjr.com/arquivo/synchronizing-execution-in-distributed-systems-using-ravendb/

madelson commented 2 years ago

Thanks! Is this something you'd be interested in contributing or just something to add to the backlog for when I get to it (either is fine with me)?

adambajguz commented 2 years ago

There is a possibility I'll be implementing RavenDB-based locking for one of my projects - if so, I'll contribute :)

However, for now I have no idea how to implement semaphores and read-writer locks (I didn't have time to think about them).

madelson commented 2 years ago

There is a possibility I'll be implementing RavenDB-based locking for one of my projects - if so, I'll contribute :)

If you get to the point of contributing post back here so we can discuss design/API. I can give you some pointers on how best to go about things.

for now I have no idea how to implement semaphores and read-writer locks

Every technology supports the basic lock (mutex), but not every one supports rw lock/semaphore. They aren't even really feasible with some technologies. Even if those others are possible with Raven, it would still be a great start to add a mutex implementation; future versions of the library could add more functionality down the road.