
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
python-dynamodb-lock-whatnick
Advanced tools
Python library that emulates the java-based dynamo-db-client from awslabs
.. image:: https://img.shields.io/pypi/v/python_dynamodb_lock.svg :target: https://pypi.python.org/pypi/python_dynamodb_lock_whatnick
.. image:: https://img.shields.io/travis/whatnick/python_dynamodb_lock.svg :target: https://travis-ci.org/whatnick/python_dynamodb_lock
.. image:: https://readthedocs.org/projects/python-dynamodb-lock-whatnick/badge/?version=latest :target: https://python-dynamodb-lock-whatnick.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
This is a fork of the currently unmaintained (2 years) of Python DynamoDB Lock <https://github.com/mohankishore/python_dynamodb_lock>
_
project. In the spirit of open-source whatnick <https://twitter.com/whatnick>
_ is maintaining this while there is some time.
Any enhancements targeting this project can be sent here.
This is a general purpose distributed locking library built on top of DynamoDB. It is heavily
"inspired" by the java-based AmazonDynamoDBLockClient <https://github.com/awslabs/dynamodb-lock-client>
_
library, and supports both coarse-grained and fine-grained locking.
Note that while the lock itself can offer fairly strong consistency guarantees, it does NOT participate in any kind of distributed transaction.
For example, you may wish to acquire a lock for some customer-id "xyz", and then make some changes to the corresponding database entry for this customer-id, and then release the lock - thereby guaranteeing that only one process changes any given customer-id at a time.
While the happy path looks okay, consider a case where the application changes take a long time, and some errors/gc-pauses prevent the heartbeat from updating the lock. Then, some other client can assume the lock to be abandoned, and start processing the same customer in parallel. The original lock-client will recognize that its lock has been "stolen" and will let the app know through a callback event, but the app may have already committed its changes to the database. This can only be solved by having the application changes and the lock-release be part of a single distributed transaction - which, as indicated earlier, is NOT supported.
That said, in most cases, where the heartbeat is not expected to get delayed beyond the lock's lease duration, the implementation should work just fine.
Refer to an excellent post by Martin Kleppmann on this subject: https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html
FAQs
Python library that emulates the java-based dynamo-db-client from awslabs
We found that python-dynamodb-lock-whatnick demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.