简体   繁体   中英

DynamoDB trigger Lambda Function

I have a dynamodb table. Whenever I add a new item to the table, a lambda function is triggered, certain processing is done and the new item is updated. It works fine, but I was wondering what if thousands of items were added at once. Will the function execute for all items at once?? Or will the execution be queued?

From Managing Concurrency , official document for AWS Lambda

Functions scale automatically based on incoming request rate

So, it means that if requests are concurrent then to handle these requests multiple instances of the same function will execute. Some of the requests may be queued.

Also from the same documentation,

By default, AWS Lambda limits the total concurrent executions across all functions within a given region to 1000.

Lambda has 100 parallel Lambda executions assuming each execution takes 1 second or more to complete.

so at a time Lambda can manage multiple executions.

From Understanding Scaling Behavior

For Lambda functions that process Kinesis or DynamoDB streams the number of shards is the unit of concurrency

Amounts of shards depend on your partition key cardinality. For example, if your partition key cardinality is 2, then you have only two shards, and concurrency of your lambda is 2.

Remember you can't control a number of shards explicit. This is a related question

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM