

- Serverless and event-driven model with pay-per-use billing.
- Supports many runtimes and custom runtimes.
- Automatic scaling within service quotas.
- Built-in retry and failure handling semantics (behavior depends on invocation type).

- Publish versions of functions and create aliases (for example, an alias named
checkout-prod) to manage production traffic. - Use weighted traffic shifting to perform blue/green or canary deployments (for example, 90% to V1 and 10% to V2). Monitor error rates and latency during the shift.
- If issues occur, point the alias back to the stable version for an immediate rollback without redeploying.

- Decouple producers and consumers with Amazon SQS, Amazon SNS, or EventBridge to improve resiliency and failure isolation.
- Example flow: seller uploads images to S3 → event enqueues a message to SQS → Lambda polls SQS and processes images (resize, watermark) → writes optimized images to output storage. This lets uploads return quickly and offloads heavy processing to asynchronous consumers.

DLQs are critical for capturing failed payloads for investigation and replay. For SQS-based flows, use the queue’s Dead-Letter Queue configuration. For asynchronous Lambda invocations, configure destinations or an SNS/SQS DLQ.
Important: retry semantics differ by invocation type—verify whether your trigger is synchronous, asynchronous, or an event-source mapping (for example,
Amazon SQS/Amazon Kinesis/DynamoDB Streams) and design dead-letter handling accordingly.- Lambda scales by creating additional execution environments (containers) as concurrent requests increase.
- Default regional concurrency quota is 1,000 concurrent executions per region (request increases as needed). Use reserved concurrency to guarantee capacity or to cap a function’s concurrency to protect downstream services.
- Cold starts occur when Lambda initializes a new execution environment: downloading code, starting the container, initializing the runtime, and running init code. Cold starts add latency to the first invocation on a new environment.
- Use Provisioned Concurrency to keep execution environments initialized and reduce cold-start latency.

- Pre-warm functions with scheduled invocations for predictable short bursts.
- Configure Provisioned Concurrency per alias or version to keep a known number of warm instances for latency-sensitive workloads.


- Place Lambdas in a VPC when they need to access resources in private subnets (RDS, ElastiCache, etc.). When a Lambda requires VPC access, Lambda creates Elastic Network Interfaces (ENIs) in your chosen subnets.
- For high availability and capacity, provide private subnets in multiple Availability Zones (ideally one subnet per AZ). Lambda will distribute ENIs and execution environments across those subnets to help maintain availability during AZ issues.

- Lambda is a regional service and its control plane and execution environments are designed for high availability across multiple AZs.
- You do not need to replicate functions manually across AZs; instead, ensure your VPC configuration (subnets, route tables, NAT/Egress) supports cross-AZ operation and scaling so Lambda can place ENIs and execution environments across AZs.

- Use versioning and aliases for safe rollouts and fast rollbacks.
- Decouple components with SQS/SNS/EventBridge for resiliency and asynchronous processing.
- Understand retry semantics and add DLQs or destinations where appropriate.
- Plan concurrency and consider Provisioned Concurrency for latency-sensitive workloads.
- When using VPC access, provide multiple private subnets across AZs and verify NAT and routing to support scaling.
Links and references
- AWS Lambda documentation
- Amazon API Gateway
- Amazon SQS Developer Guide
- Amazon SNS Developer Guide
- Amazon EventBridge User Guide
- AWS Lambda Provisioned Concurrency
- AWS Lambda and VPC configuration