Skip to main content

Simple distributed lock with support for multiple backends

Project description

Build Status Version

Stormlock is a simple centralized locking system primarily intended for human operators (although it may also be useful in some simple scripting scenarios).

The basic idea is that you acquire a lock by running a command, which gives you a “lease id”. That lease id can then be used to release the lock, or extend its duration. All locks are given a duration after which they are automatically released. The lock is stored in a backend, which is generally some kind of database.

The intended use case is where you have some kind of operation which happens somewhat infrequently across a distributed system, and you want to ensure multiple operators don’t perform the operation at the same time. For example, this could be used to make sure to prevent simultaneous attempts to apply infrastructure-as-code changes, database patches, etc. to the same system by different operators.

This is not intended as a general purpose lock. It is designed with the assumption that locks can be held for a long time without problems (hours or even days), and that the TTL for the lock doesn’t need granularity better than a second. Furthermore, the availability of the lock is a function of the availability of the backend it uses.

Backends

The currently supported backends are:

  • Etcd
    • Renewing a lock always uses the same TTL as the original acquisition

  • Redis

  • DynamoDB

  • PostgreSQL

It’s also possible to implement your own backend by implementing the stormlock.Backend interface and registering the class in the stormlock.backends entry point in python.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stormlock-0.1.2.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

stormlock-0.1.2-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file stormlock-0.1.2.tar.gz.

File metadata

  • Download URL: stormlock-0.1.2.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.3 Linux/5.3.0-1032-azure

File hashes

Hashes for stormlock-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b964a65314f73246d19e31d0cb034fbe52a44251274e35eb2920cc8d1481b250
MD5 bdd24c2abf8df6d6493e1a3ad3284d96
BLAKE2b-256 2a3872f4f2c5e5771225a761d2b57b5f2db43dd3ea113ceb65bb755e5559d616

See more details on using hashes here.

File details

Details for the file stormlock-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: stormlock-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.3 Linux/5.3.0-1032-azure

File hashes

Hashes for stormlock-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6d6fe2c9b911d22f2406c86dad78b4178a98276fbc40d81e863f94ac62440161
MD5 ff9057816841b75d9acf96c737140358
BLAKE2b-256 4462a0550ea48ef675333b35bee6cec40b4e8b94637c9682617af2eb3acc0bdd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page