CloudGuild · Blog · Cheat sheets · Lessons · Certifications
AWS Lambda Event Sources & Concurrency — Efficient Event-Driven Architecture
AWS Lambda allows you to run code in response to events without provisioning servers, supporting various event sources and managing concurrency effectively.
What it is
- AWS Lambda is a serverless compute service that runs your code in response to events.
- Supports multiple event sources like S3, DynamoDB, Kinesis, SNS, and API Gateway.
When I reach for it
- Use Lambda when you need to execute code in response to events without managing servers.
- Ideal for microservices architectures, real-time data processing, and automated workflows.
Key architectural decisions
- Event Source: Choose the right event source based on your use case (e.g., S3 for file uploads, SNS for messaging).
- Concurrency Management: Decide on reserved concurrency limits to control scaling and resource allocation.
- Error Handling: Implement DLQ (Dead Letter Queue) for event failure handling.
Gotchas & exam traps
- Remember that Lambda has a maximum execution timeout of 15 minutes.
- Cold starts can impact performance; be cautious with VPC configurations as they can increase cold start times.
- Understand the limits of concurrent executions (default limit is 1,000 per region).
The architect view
- Leverage Lambda for scalability and cost-effectiveness in event-driven architectures.
- Monitor and optimize performance with AWS CloudWatch metrics and alarms.
- Ensure proper security practices by managing IAM roles and permissions for Lambda functions.