SVS407_Understanding-AWS-Lambda-event-source-mapping
SVS407_Understanding-AWS-Lambda-event-source-mapping
SVS407-R
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is an event source connector
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Lambda event source mapping (ESM)
An event source mapping is a Lambda resource that
reads items from stream- and queue-based services and
invokes a function with batches of records
Lambda
Queue / Stream
ESM
Lambda
function
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda invocation models
Synchronous Asynchronous Poll-based
Amazon Amazon
Amazon
SNS SQS
API Gateway
Amazon Amazon
S3 Kinesis
/order
reqs Changes
event event
AWS Lambda
Synchronous
Lambda Lambda Lambda
function function function
event
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How Lambda ESM works
3. If the Lambda returns successfully
1. Lambda Service polls the queue / stream then the Lambda service advances to
the next set of records and repeats #1
Lambda
Queue / Stream
ESM
Lambda
function
On-failure
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. destination
Error handling – ReportBatchItemFailures
1. Report batch item failure (3,6)
(3)
Lambda
Stream
2. Stream
2. Stream checkpoints
checkpoints to
to 8 7 6 5 4 3 2 1
sequence numbernumber
lowest sequence from (3)
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Error handling – BisectBatchOnFunctionError
Lambda
8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1 4 3 2 1
= Record #3 found.
Retry based on MaxRetry
and record age settings
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Service integration
breakdown
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Services
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Whiteboarding
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Resources: serverlessland.com
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continue your AWS serverless learning
Learn at your Increase your Earn AWS
own pace knowledge Serverless badge
https://s12d.com/serverless-learning
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Best practices, for everyone
Batch processing Config management
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Check out these other sessions
SVS216: Serverless data processing with AWS Lambda and Apache Kafka (Builders session)
Wednesday (Dec. 4) @ 8:30a – Mandalay Bay Surf B*
SVS321: AWS Lambda and Apache Kafka for real-time data processing applications (Breakout
session)
*Times and locations are subject to change;
Look for YouTube after re:Invent! check session catalog for up-to-date information
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you! Please complete the session
survey in the mobile app
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.