Serverless - Lambda Flashcards
What is AWS Lambda?
AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the compute resources.
What is the maximum execution time for a Lambda function?
15 minutes per invocation.
How does Lambda scale?
Lambda automatically scales by running code in parallel in response to incoming requests or events.
Why is Lambda considered cost-effective?
You only pay for the compute time and requests, and it offers a generous free tier.
How can you limit the number of concurrent executions for a Lambda function?
By setting a reserved concurrency limit at the function level.
What happens if a Lambda function exceeds its reserved concurrency limit?
Invocations beyond the limit are throttled.
What is the default account-wide concurrency limit for Lambda functions?
1,000 concurrent executions per region.
Can the account-wide concurrency limit be increased?
Yes, by submitting a support request to AWS.
What is provisioned concurrency in Lambda?
It pre-allocates instances of a Lambda function to avoid cold starts and reduce latency.
What is Lambda SnapStart?
It improves your Lambda functions performance up to 10x at no extra cost for Java 11 and above by invoking it from a pre-initialised state.
What are the two types of Edge Functions provided by AWS?
CloudFront Functions and Lambda@Edge.
What are CloudFront Functions used for?
High-scale, latency-sensitive customizations for viewer requests and viewer responses.
What events can Lambda@Edge modify?
Viewer request
Viewer response
Origin request
Origin response
Where are Lambda functions launched by default?
In an AWS-managed VPC, outside of the user’s VPC.
Can a default Lambda function access private resources in your VPC?
No, it cannot access private resources like RDS, ElastiCache, or internal load balancers.
What problem arises when Lambda functions access RDS directly under high load?
Too many open connections can cause timeouts and database issues.
What are the three benefits of using an RDS proxy with Lambda?
Improved scalability: By pooling and sharing database connections.
Improved availability: Reduces failover time by 66% and preserves connections.
Enhanced security: Enforces IAM authentication and integrates with AWS Secrets Manager.
Why must Lambda functions be in the same VPC as the RDS proxy?
The RDS proxy is private and not publicly accessible, so Lambda must be in the VPC for network connectivity.
What service helps Lambda handle database connections more efficiently in a VPC?
RDS Proxy.
What is an example use case for direct Lambda invocation from a database?
A user inserts data into a table (e.g., a registration table), and the database invokes a Lambda function to send a welcome email.
Which databases support invoking Lambda functions directly?
RDS for PostgreSQL
Aurora MySQL