Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Blob Lease implementation #42

Closed
dazinator opened this issue Feb 22, 2020 · 6 comments
Closed

Azure Blob Lease implementation #42

dazinator opened this issue Feb 22, 2020 · 6 comments
Milestone

Comments

@dazinator
Copy link

dazinator commented Feb 22, 2020

Looking at distributed locking purely from an Azure perspective (I have an Azure subscription).

After looking at what mechanisms were available for distributed locking on Azure, one thing that came up was Azure Blob Leases.

It seems "Azure Web Jobs" actually uses this mechanism behind the scenes for singleton jobs that shouldn't be run in parallel - mentioned on answer here:
http://justazure.com/azure-blob-storage-part-8-blob-leases/

Perhaps there is room for an Azure Blob Lease based implementation in this repo in future?

I mention this because I think Azure Blob Leases is probably the simplest way to start using distributed locking (ahead of sql server) for azure subscribers, because all it requires is an azure storage account, which you often have to create anyway to get started.

SQL is the probably the next easiest option then - as that then requires you to add Sql Azure to your azure subscription which adds an extra fee. Not all apps may require Sql server, but most apps do require disk / file storage.

Lastly, third party services like Zookeeper and others are probably the hardest as they require setup of that third party system first.

With that in mind - adding an Azure Blob Lease based distributed lock implementation might be a great addition to this repo.

@madelson
Copy link
Owner

madelson commented Feb 22, 2020

@dazinator do you have experience working with these, and in particular creating an environment for testing the implementation? Is there a way to run a mock version of blob storage locally or would it need to be tested through an actual Azure account?

@dazinator
Copy link
Author

@madelson You should be able to run Azure Storage emulator locally, and then develop against that: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator

@madelson
Copy link
Owner

@dazinator I have an implementation of this built out in the working branch for 2.0 (https://github.com/madelson/DistributedLock/tree/release-2.0/DistributedLock.Azure). If you'd be interested in using it I can look into publishing a prerelease version.

@dazinator
Copy link
Author

@madelson awesome! A pre-release would be good, as I can then set up some simple POC's with it.

@dazinator
Copy link
Author

@madelson did you manage to release this in the end?

@madelson
Copy link
Owner

madelson commented Aug 28, 2020

@dazinator sorry I completely missed your follow-up! I've published a prerelease version of the 2.0 packages. You can install the full suite with https://www.nuget.org/packages/DistributedLock/2.0.0-alpha01 or just the azure stuff with https://www.nuget.org/packages/DistributedLock.Azure/.

Let me know if you find any issues!

@madelson madelson added this to the 2.0 milestone Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants