Add Lambda Durable Functions parallel processing pattern This pattern…#2949
Conversation
… demonstrates parallel processing using AWS Lambda Durable Functions to execute multiple independent operations concurrently, achieving better performance improvement over sequential execution. Features: - Parallel execution with context.parallel() and child contexts - Automatic checkpointing and fault tolerance - Comprehensive error handling and validation - Human-readable logging with step indicators across all functions - Production-ready with structured logging - Complete test scenarios and documentation Implementation: - 1 orchestrator function coordinating parallel execution - 4 worker functions: inventory, payment, shipping, tax - Proper handling of parallel() return format (extracts from .all array) - Child context usage for isolated checkpoint management - Durable wait demonstration (1 second pause without compute charges) The pattern includes: - Complete SAM template with IAM permissions - Comprehensive README with deployment and testing instructions - Example test events and expected responses - Architecture documentation - Implementation details for parallel execution patterns
|
Please make sure to use the correct capitalization: It's Lambda durable functions not Lambda Durable Functions |
|
Made those capitalization changes. Please comment if any other changes needed. |
| @@ -0,0 +1,67 @@ | |||
| { | |||
| "title": "Parallel Processing with AWS Lambda durable functions", | |||
| "description": "Order processing workflow using Lambda durable functions with parallel execution of multiple validation steps including inventory, payment, shipping, and tax calculations", | |||
There was a problem hiding this comment.
description should be <= 150 char length
| { | ||
| "name": "Sasidharan Ramasamy", | ||
| "bio": "Technical Account Manager @ AWS with over 10 years of industry experience", | ||
| "linkedin": "https://www.linkedin.com/in/sasidharan-ramasamy/" |
There was a problem hiding this comment.
Please remove the URL in this property, only include the ID to your LinkedIn profile.
| @@ -0,0 +1,141 @@ | |||
| # Submission Notes for lambda-durable-parallel-processing-sam | |||
There was a problem hiding this comment.
What is this file for? Seems to be gen AI generated file.
| - Effect: Allow | ||
| Action: | ||
| - lambda:InvokeFunction | ||
| Resource: '*' |
There was a problem hiding this comment.
Please make the policy more restrictive than '*'. Too much permission is provided.
| Action: | ||
| - lambda:CheckpointDurableExecution | ||
| - lambda:GetDurableExecutionState | ||
| Resource: '*' |
There was a problem hiding this comment.
Please make the policy more restrictive than '*'. Too much permission is provided.
|
|
||
| ### Architecture | ||
|
|
||
| The solution consists of five Lambda functions: |
There was a problem hiding this comment.
Can you include an architecture diagram?
|
|
||
| 2. Change directory to the pattern directory: | ||
| ```bash | ||
| cd lambda-durable-parallel-processing-sam |
There was a problem hiding this comment.
cd serverless-patterns/lambda-durable-parallel-processing-sam
|
|
||
| 5. From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yml file: | ||
| ```bash | ||
| sam deploy --guided |
There was a problem hiding this comment.
Deploy failed with the following error:
Error: Failed to create changeset for the stack: lambda-durable-fn, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state: For expression "Status" we matched expected path: "FAILED" Status: FAILED. Reason: Requires capabilities : [CAPABILITY_NAMED_IAM]
|
|
||
| Once you have run `sam deploy --guided` mode once and saved arguments to a configuration file (samconfig.toml), you can use `sam deploy` in future to use these defaults. | ||
|
|
||
| 7. Note the outputs from the SAM deployment process. These contain the resource names and/or ARNs which are used for testing. |
There was a problem hiding this comment.
The deploy command outputs TestCommand. However, that command is not well formatted and throws error.
|
|
||
| - [Lambda durable functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) | ||
| - [Durable Execution SDK for JavaScript](https://github.com/aws/aws-durable-execution-sdk-js) | ||
| - [Parallel Processing Patterns](https://docs.aws.amazon.com/lambda/latest/dg/durable-parallel.html) |
There was a problem hiding this comment.
This link is forwarding to somewhere else now.
Issue #, if available:
Description of changes:
Created new pattern to showcase lambda durable function - parallel processing use case in Node JS
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.