3 ms·
Distributed Locking With DynamoDB
- zzzeek 14y agoThere's two variants I've observed with the term "distributed locking", which this article kind of gets at, though IMO not enough to make it clear to someone who also needs to read a section called "What's a lock". Most of the time, when people talk about a "distributed lock", the emphasis is on the fact that the clients are distributed. You can set up a Redis server, and lots of different hosts can contact it and hit the SETNX message to see if some key is locked. But then other folks would say, that's not distributed at all - because the redis server everyone's hitting SETNX on is a single point of failure. It's the servers that need to be distributed. That's a harder task, because the servers need to coordinate on whether or not key "X" is truly available or not in an atomic way, and that's the "consensus algorithm" thing that doozerd and I've also heard Zookeeper does, which I can only start to imagine how that works. Based on the DynamoDB docs at http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/WorkingWithDDItems.html#WorkingWithItemsConditionalUpdate http://docs.amazonwebservices.com/amazondynamodb/latest/deve... it seems like conditional updates work across distributed replicas, though it's only implied.
- deleted 14y ago[deleted]
- philip1209 14y agoThe submitted link is a redirect - I believe the guidelines imply that submitted links should not be redirects or tracking links.
- balakk 14y agoFor those working with Azure, you can take a lease on a blob to manage concurrency: http://blog.smarx.com/posts/managing-concurrency-in-windows-azure-with-leases http://blog.smarx.com/posts/managing-concurrency-in-windows-... It also has high availability, lease expiration timeouts etc.