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.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: stormlock-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0f79d2fd74e5c1d54c2df6faacd9ad7fa87eb465abebb6c4f1df637ae80ae946
MD5 137a1987688f247b6e2c4b0120b5e501
BLAKE2b-256 10d8f743be30449cca526369270bcce62f21f8d4dece1ba352d538456bfa34b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: stormlock-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ef04e2100b9c3e7c4cad305cfac5b3d1248f7fe9306302b6000cfd7d3f95595
MD5 33daf73dbdf1f01ab93349f857bedfe5
BLAKE2b-256 2d65b574645e675039952cf604812eb1e94d686438f772364cbd945942fbbf55

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