Dev.to
5/11/2026

From 15-Minute Lambda Timeouts to Sub-Second Runs — A DynamoDB Optimization Story
Short summary
Two AWS Lambda functions timing out at the 15-minute ceiling failed to process daily stats due to fetching full DynamoDB items with unused fields and recomputing history daily. The author fixed three compounding issues: ProjectionExpression to fetch only needed fields (80-90% payload reduction), S3-based state tracking to query only new data since last run, and incremental processing to avoid full table scans. Result: calculatePartnerNotificationStats reduced from timeout to sub-second execution.
- •Lambda functions hit 15-minute timeout due to inefficient DynamoDB queries and full daily history recomputation
- •Three fixes: ProjectionExpression for lean payloads, S3 delta tracking, incremental queries instead of full scans
- •Performance: 900+ second runs reduced to sub-second completion
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



