@shelf/dynamodb-parallel-scan

Scan large DynamoDB tables faster with parallelism

Usage no npm install needed!

<script type="module">
  import shelfDynamodbParallelScan from 'https://cdn.skypack.dev/@shelf/dynamodb-parallel-scan';
</script>

README

dynamodb-parallel-scan CircleCI npm (scoped)

Scan DynamoDB table concurrently (up to 1,000,000 segments), recursively read all items from every segment

Install

$ yarn add @shelf/dynamodb-parallel-scan

Usage

const {parallelScan} = require('@shelf/dynamodb-parallel-scan');

(async () => {
  const items = await parallelScan(
    {
      TableName: 'files',
      FilterExpression: 'attribute_exists(#fileSize)',
      ExpressionAttributeNames: {
        '#fileSize': 'fileSize'
      },
      ProjectionExpression: 'fileSize'
    },
    {concurrency: 1000}
  );

  console.log(items);
})();

Read

License

MIT © Shelf