/dynamodb-parallel-scan

Scan large DynamoDB tables faster with parallelism

Primary LanguageJavaScriptMIT LicenseMIT

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