Serverless Flashcards

1
Q

What’s Serverless ? Tell name of services which are serverless in AWS ?

A
  1. Serverless is a new paradigm in which we don’t need to manage servers anymore. We just deploy our code or functions.
  2. For example Lambda, Cognito, S3, API Gateway, DynamoDB, Kinesis, Aurora, SNS and SQS etc are managed services in AWS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why do we need AWS Lambda ? Why it’s preferred over EC2 ?

A
  1. EC2 has some drawbacks. EC2 are virtual servers on the cloud. We require manual intervention to add/remove servers. They are limited by CPU and RAM. They are continuously running.
  2. On the other hand Lambda are virtual functions. We don’t need to manage servers. They run on demand. Even scaling is automated.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some salient features of Lambda ?

A
  1. Easy Pricing - Pay per request and compute time. Free tier of 10,00,000 requests and 4,00,000 GBs of compute time
  2. Integrated with whole suite of services and many programming languages
  3. Easy monitoring with AWS CloudWatch
  4. Easy to get more resources per Lambda function (up to 10 GBs of RAM)
  5. INCREASING RAM WILL ALSO IMPROVE CPU & NETWORK
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What languages are supported by Lambda ?

A
  1. NodeJS
  2. Python
  3. Java
  4. C#
  5. Ruby
  6. Custom Runtime API. Community supported, for example Rust & Golang
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can we expose a Lambda function as an HTTPS endpoint ?

A

We can integrate a Lambda function with an Application Load Balancer or API Gateway. The Lambda function must be registered in a target group.

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

How can we synchronously and asynchronously invoke a Lambda function ?

A
  1. Synchronous Invocation - CLI, SDK, API Gateway, Application Load Balancer. Results are returned right away and error handling must happen client side.
  2. Asynchronous Invocation - S3, SNS & CloudWatch Events, Event Bridge, Code Commit, Code Pipeline. The events are placed in an Event Queue. Lambda retries 3 times on errors. 1 min wait after first retry. 2 mins wait after second retry. We have to ensure our function is idempotent because of retries. We can define SQS or SNS as a Dead Letter Queue for failed processing.
  3. We can invoke Lambda function from a cron job trigger using EventBridge
  4. We can invoke Lambda function on STATE change in CodePipeline
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can we deliver S3 event notifications to Lambda functions

A
  1. S3 event notifications - We can generate events every time an object is created, removed, restored or replicated in S3 bucket. (APIs - S3: ObjectCreated, S3: ObjectRemoved, S3:ObjectRestored, S3:Replication)
  2. Use case - Create thumbnails of images uploaded in S3

3.Typically events are delivered in seconds, but sometimes it could take more than a minute or two

  1. For ensuring successful event notifications for every write, we can enable versioning on the S3 bucket
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly