Hacker News new | ask | show | jobs
by GordonS 1464 days ago
Random thought - doesn't S3 have a leasing/locking system that could be used for distributed locks?
2 comments

Unfortunately, it doesn't. That was actually the reason I built this originally - there's no easy way to control read/write access to a file on S3 without using some sort of external locking system.
You can add locks to objects, which restricts who can delete them and how, but requires bucket wide settings.
BTW, this is true, but that is not locking in the "sync locking" sense.
It's not the intended purpose but they can be used like this. Lock files can be written, will fail if they already exist - that gets you a distributed equivalent to flock doesn't it?
Have you looked at Azure Blob Storage's lock feature? Could that be used?
Did Zookeeper or Etcd not suit your needs?
They are valid solutions for this use-case; the main drawback is you need to set up and maintain a ZooKeeper cluster. Lockable is intended as a simpler and faster-to-use alternative.
AWS recommends using dynamo and has a Java reference implementation. Afaik GCP doesn't support locks either. Azure supports locks on blob store (their object store service)
Ah, someone mentioned it in reference to Azure Blob Storage recently, and I had (apparently incorrectly) assumed it was also an S3 feature.

Any reason Azure Blob Storage couldn't be used as a no-setup, managed, cheap way to acquire distributed locks?

azure blob store is literally used as a cheap way to acquire distributed lock today by the azure sdk.

if you look at azure event hub library they use blob as lock to partition the consumer instances at runtime.