awslabs / amazon-dynamodb-lock-client

The AmazonDynamoDBLockClient is a general purpose distributed locking library built on top of DynamoDB. It supports both coarse-grained and fine-grained locking.
Other
476 stars 87 forks source link

Batch Locking #40

Open krishnalpatel opened 5 years ago

krishnalpatel commented 5 years ago

Provide ability to acquire lock on multiple keys in a single dynamo db query (BatchPutItem or BatchWriteItem) Currently, the implementation of acquireLock is such that it can only acquire lock for a single key at a time, using PutItem We have a use case where we need to iterate over a list of objects and acquire a lock on each before proceeding further. When this list hits a considerable size, having multiple dynamodb queries increases the latency manifolds. We were looking on acquiring all the locks in a single query and release them in a single query as well to avoid multiple dynamodb queries and thereby improving latency.