Serverless - Lambda Flashcards

1
Q

What is AWS Lambda?

A

AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the compute resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the maximum execution time for a Lambda function?

A

15 minutes per invocation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does Lambda scale?

A

Lambda automatically scales by running code in parallel in response to incoming requests or events.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why is Lambda considered cost-effective?

A

You only pay for the compute time and requests, and it offers a generous free tier.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you limit the number of concurrent executions for a Lambda function?

A

By setting a reserved concurrency limit at the function level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What happens if a Lambda function exceeds its reserved concurrency limit?

A

Invocations beyond the limit are throttled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the default account-wide concurrency limit for Lambda functions?

A

1,000 concurrent executions per region.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Can the account-wide concurrency limit be increased?

A

Yes, by submitting a support request to AWS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is provisioned concurrency in Lambda?

A

It pre-allocates instances of a Lambda function to avoid cold starts and reduce latency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Lambda SnapStart?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the two types of Edge Functions provided by AWS?

A

CloudFront Functions and Lambda@Edge.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are CloudFront Functions used for?

A

High-scale, latency-sensitive customizations for viewer requests and viewer responses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What events can Lambda@Edge modify?

A

Viewer request
Viewer response
Origin request
Origin response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Where are Lambda functions launched by default?

A

In an AWS-managed VPC, outside of the user’s VPC.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Can a default Lambda function access private resources in your VPC?

A

No, it cannot access private resources like RDS, ElastiCache, or internal load balancers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What problem arises when Lambda functions access RDS directly under high load?

A

Too many open connections can cause timeouts and database issues.

17
Q

What are the three benefits of using an RDS proxy with Lambda?

A

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.

18
Q

Why must Lambda functions be in the same VPC as the RDS proxy?

A

The RDS proxy is private and not publicly accessible, so Lambda must be in the VPC for network connectivity.

19
Q

What service helps Lambda handle database connections more efficiently in a VPC?

A

RDS Proxy.

20
Q

What is an example use case for direct Lambda invocation from a database?

A

A user inserts data into a table (e.g., a registration table), and the database invokes a Lambda function to send a welcome email.

21
Q

Which databases support invoking Lambda functions directly?

A

RDS for PostgreSQL
Aurora MySQL