Section 11: Serverless Applications Flashcards

1
Q

What is AWS Lambda?

A

AWS Lambda is a compute service that lets you run code without provisioning or managing servers.

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

What is Lambda max execution time?

A

Lambda max execution time is 15mins

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

Lambda benefits

A

Lambda benefits include:
* executes code only when needed and scale automatically
* no servers to manage
* millisecond billing
* integrates with almost all other AWS services

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

How to invoke Lambda function?

A

Synchronous:
* CLI, SDK, API Gateway
* Waits for the function to processs the event and then returns a response
* Error handling happens on client-side (retries, exponential backoff etc)

Asynchronous:
* S3, SNS, CloudWatch Evnets
* Event is queued for processing and a response is returned immediately
* Lambda retries up to 3 times

Event source mapping:
* SQS, Kinesis Data Streams, DynamoDB Streams
* Lambda does the polling (polls the source)

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

Application Intergration Services Overview

A

SQS (Simple Queue Service)
* Messaging queue, store and forward patterns.
* Use case: building distrubted / decoupled applications

SNS (Simple Notification Service)
* setup, operate and send notifiations from the cloud
* use case: send email notification when CloudWatch alarm is triggered

Step Functions
* Out-of-the-box coordingation of AWS service compeonts with visual workflow
* use case: order processing workflow

Simple Workflow Service
* need to support external processes or specialised execution logic
* use case: human-enabled workflows like an order fulfiilmentsystem or for proceduaral requests. Note: AWS reccomends using Step Function instead of this.

Amazon MQ
* message broker service for Apache Active My and Rabbit MQ
* use case: need a message queue that supports industry standard APIs and protocols. Migrate queues to AWS

Amazon Kenisis
* collect, process and analyise streaming data
* use case: collect data from IoT devices for later processing

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

What is AWS EventBridge?

A

EventBridge is a serverless service that uses events to connect application components together, making it easier for you to build scalable event-driven applications.

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

How does EventBridge work?

A

Event sources such as AWS services, custom apps or Saas app trigger an event. EventBridge processes the events on its event bus and using rules defined and then sends onto various destinations know as targets.

In short:
1. Event sources (e.g. EC2) trigger events (e.g. service terminated)
2. Events are then put onto the EventBridge event bus
3. Rules defined in the event bus then define how those events are sent outo various targets (other AWS services)

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

AWS API Gateway deployment types

A

Edge-optimised endpoint
* CloudFront (CDN) —> API Gateway
* reduced latency

Regional endpoint
* Services in same region —> API Gateway
* reduced latency for request that originate in the same region
* can configure your own CD and protect with WAF

Private endpoint
* Services in same VPC —> API Gateway
* securely expose your REST APIs only to other services within your VPC or connect via Direct Connect

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

Which services form the app-facing part of the AWS serverless infrastructure?

A

Lambda and API Gateway

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

Which of the following are NOT Amazon SNS transport protocols?

A

AWS Lambda

AWS Lambda is a supported subscriber but not a transport protocol.

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

How can you save cost when checking for messages on an Amazon SQS queue?

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

How can you save cost when checking for messages on an Amazon SQS queue?

A

Use long polling

Long polling uses fewer requests and reduces cost.

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

How can you scale Amazon SQS?

A

Add more queues

You scale SQS by creating more queues.

Note: you can not implement auto scaling using SQS.

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

What is the purpose of the SQS message visibility timeout?

A

To add resiliency in case a processor fails to complete a job

The visibility timeout helps with resiliency so if an application component processing a message fails to complete the job another one can retry it.

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

Which service requires application components to poll for new messages?

A

Amazon SQS

SQS is poll-based not push-based.

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

Where is the event source mapping specified for integrating Amazon Kinesis with Lambda?

A

AWS Lambda

The event source mapping is specified on the Lambda side for stream-based services.

17
Q

Where is the event source mapping specified for integrating Amazon API Gateway with Lambda?

A

Amazon API Gateway

The event source mapping is specified on the Amazon API Gateway side as it is not a stream-based service

18
Q

Cheatsheets

A

AWS Lambda - https://digitalcloud.training/aws-lambda/

API Gateway - https://digitalcloud.training/amazon-api-gateway/

AWS Application Integration Services - https://digitalcloud.training/aws-application-integration-services/

Amazon CloudWatch - https://digitalcloud.training/amazon-cloudwatch/