Skip to content

Azure Blob Lease implementation #42

Closed

Description

@dazinator

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.

Activity

  1. madelson commented on Feb 22, 2020

    @madelson
    Owner

    @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?

  2. dazinator commented on Feb 22, 2020

    @dazinator
    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

  3. added a commit that references this issue on Apr 18, 2020
    f3581f9
  4. madelson commented on Apr 18, 2020

    @madelson
    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.

  5. dazinator commented on Apr 18, 2020

    @dazinator
    Author

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

  6. dazinator commented on Aug 27, 2020

    @dazinator
    Author

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

  7. madelson commented on Aug 28, 2020

    @madelson
    Owner

    @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!

  8. added this to the 2.0 milestone on Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions