dynamodb-scan
EventEmitter to simplify dynamodb parallel scans
Features
- EventEmitter pattern for dynamodb scan
- Data event emitted for each record
- Supports pause/resume of emitter
- DynamoDb parallel scans supported
Installation
$ npm install dynamodb-scan --save
Usage
'use strict'; var DynamoDbScan = ; var dynamoDbScan = 'awsAccessKey' 'awsSecret' 'awsRegion' 'tableName'; var count = 0; dynamoDbScan; dynamoDbScan; dynamoDbScanstart;
Parallel Scans are useful to maximize usage of throughput provisioned on the DynamoDb table.
Documentation
new DynamoDbScan(awsAccessKeyId, awsSecretAccessKey, awsRegion, tableName, options)
Sets up the AWS credentials to use
Arguments
awsAccessKeyId
- AWS access key if not provided falls back to whatever AWS SDK can findawsSecretAccessKey
- AWS secret if not provided falls back to whatever AWS SDK can findawsRegion
- AWS region if not provided falls back to whatever AWS SDK can findtableName
- Name of table to scanoptions
- OptionsparallelScans
- Number of parallel scans to run. Defaults to 1maxRetries
- Number of times to retry a failed dynamo db operation. Passed to aws-sdk.
start()
Starts the scan. Method available so you can hook up your listeners before it starts emitting events.
pause()
Pauses a scan. Events may still be emitted from the previous scan operation.
resume()
Resumes a paused scan.
paused()
Returns true if emitter is paused
People
The author is Chris Kinsman from PushSpring