Serverless Applications Flashcards

(43 cards)

1
Q

What is process of Event-Driven Architecture in Serverless Enviornment?

Serverless Services and Event-Driven Architecture

A
  1. User uploads file through static website
  2. Serverless function processes file
  3. Processed file is stored in bucket
  4. Notification sent using SNS & email
  5. Function processes message & stores information in database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are features of Serverless Services?

Serverless Services and Event-Driven Architecture

A
  • No instances to manage
  • No need to provision hardware
  • No management of OS or software
  • Capacity provisioning & patching handled automatically
  • Provides automatic scaling & high availability
  • Very cheap
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is AWS Lambda?

AWS Lambda

A

Event-driven serverless compute service for running code w/out having to provision or manage server

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

What is Lambda process?

AWS Lambda

A
  • Developer uploads some code
  • Event occurs. Can be:
    • CLI
    • API
    • SDK
    • Trigger
  • Code executed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are features of Lambda?

AWS Lambda

A
  • Executes code only when needed & scales automatically
  • Only pay for compute time used (not when code is not running)
  • Benefits
    • No servers to manage
    • Continious scaling
    • Millisecond billing
    • Integrates w/ other most other AWS service
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are Primary use cases for Lambda?

A
  • Data processing
  • Real-time file processing
  • Real-time stream processing
  • Build serverless backends for web, mobile, IOT, & 3rd party API requests
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you invoke Lambda functions w/ Synchronous?

AWS Lambda

A
  • CLI, SDK, API Gateway
  • Wait for function to process event & return response
  • Error handling happens client side (retries, exponential backoff, etc.)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you invoke Lambda functions w/ Asynchronous?

AWS Lambda

A
  • S3, SNS, CloudWatch Events, etc . . .
  • Event is queued for processing & response is returned immediately
  • Lambda retries up to 3 times
  • Processing must be idempotent (due to retries)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can you invoke Lambda functions w/ Event Source Mapping?

AWS Lambda

A
  • SQS, Kinesis Data Stream, DynamoDB Streams
  • Lambda does polling (polls source)
  • Records processed in order (except for SQS standard)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

True or False

SQS can also trigger Lambda

AWS Lambda

A

TRUE

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

What are Lambda Function Concurrency Rules?

AWS Lambda

A
  • Additional functions are initalized up to burst or account limit
  • If concurrency limit is exceeded:
    • throttling occurs w/ error Rate exceeded
    • 429: TooMany Requests Exception
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Simple Queue Service (SQS)?

Application Integration Services Overview

A

Message queue; store & forward patterns

Ex: Building distributed/decoupled applications

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

What is Simple Notification Service (SNS)?

Application Integration Services Overview

A

Set up, operate, & send notifications from cloud

Ex: Send email notification when CloudWatch alarm is triggered

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

What are Step Functions?

Application Integration Services Overview

A

Out-of-box coordination of AWS service components w/ visual workflow

Ex: Order processing workflow

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

What is Simple Workflow Service?

Application Integration Services Overview

A

Need to support external processes or specialized execution logic

Ex: Human-enabled workflows like an order fulfillment system or for procedural requests
Note: AWS recommends that for new applications customers consider Step Functions instead of SWF

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

What is Amazon MQ?

Application Integration Services Overview

A

Message broker service for:
- Active MQ
- RabbitMQ

Ex: Need message queue that supports industry standard APIs & protocls; migrate queues to AWS

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

What is Amazon Kinesis?

Application Integration Services Overview

A

Collect, process, & analyze streaming data

Ex: Collect data from IoT devices for later processing

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

Describe features of Kinesis

Application Integration Services Overview

A
  • Consumers pull data
  • As many consumers as you need
  • Routes related records to same record processor
  • Multiple applications can access stream concurrently
  • Ordering at shard level
  • Can consume records in correct order at later time
  • Must provision throughput
19
Q

Describe features of Amazon SQS

Application Integration Services Overview

A
  • Consumers pull data
  • Data deleted after being consumed
  • Can have as many workers (consumers) as you need
  • No ordering guarentee (except w/ FIFO queues)
  • Provides messaging semantics
  • Individual message delay
  • Dynamically scales
20
Q

Describe features of SNS

Application Integration Services Overview

A
  • Push data to many suscribers
  • Publisher / subscriber model
  • Integrates w/ SQS for fan-out architecture pattern
  • Up to 10,000,000 subscribers
  • Up to 100,000 topics
  • Data IS NOT persisted
  • No need to provision throughput
21
Q

What are features of Standard Queues?

SQS Queues

A
  • Unlimited Throughput - support nearly unlimited number of transactions per second (TPS) per API action
  • Best-Effort Ordering - Sometimes, messages might be delivered in order from which they were sent
  • At-Least-Once Delivery - Message delivered at least once, but occasionally more than one copy of message is delivered
22
Q

What are features of FIFO Queues?

SQS Queues

A
  • High Throughput - support up to 300 messages per second.
    • When 10 messages are batch per operation (maximum), can support up to 3,000 messages per second
  • First-In-First-Out Delivery - Order which messages are sent & received strictly preserved
  • Exactly-Once Processing - Message delivered once & remains available until consumer processes & deletes it.
    • No duplicates go in queue
23
Q

What are other features of FIFO Queues?

SQS Queues

A
  • Require Message Group ID * & Message Deduplication ID paramters to be added to messages
24
Q

What is Message Group ID?

SQS Queues

A

Tag that specifies message belongs to specific message group Messages that belong to same message group are guaranteed to be processed in FIFO manner

25
What is **Message Deduplication ID**? ## Footnote **SQS Queues**
Token used for deduplication of messages w/in deduplication interval
26
What is **SQS - Dead Letter Queue**? ## Footnote **SQS Queues**
- Main task - handling message failure - Lets you set aside & isolate message that can't be processed correctly to determine why their processing didn't succeed - Not Queue Type: **Standard** or **FIFO** queue that has been specified as dead-letter queue in configuration of **another** standard or FIFO queue.
27
What are settings of **Dead Letter Queues**? ## Footnote **SQS Queues**
- Enable Redrive Policy - Specify queue to use as dead-letter queue - Specify maximum receives before message is sent to dead-letter queue
28
What is **Long Polling**? ## Footnote **SQS Queues**
- Way to retrieve messages from SQS queues - waits for messages to arrive - can lower costs - can be enabled at queue level or at API level using **WaitTimeSeconds** - In effect when Receive Message Wait Time is value greater than **0 seconds** up to **20 seconds**
29
What is **Short Polling**? ## Footnote **SQS Queues**
Returns immediately (even is message queue is empty)
30
What does an **Event Producer** do? ## Footnote **Amazon SNS**
Sends one message to SNS topic
31
# **True or False** Does each subscriber get all messages? ## Footnote **Amazon SNS**
True
32
# **True or False** Many suscribers listen for notifications
True
33
What are features of Amazon SNS? ## Footnote **Amazon SNS**
- Highly available, durable, secure, fully managed pub/sub messaging service - Provides topics for high-throughout, push-based, many-to-many messaging - Publisher systems can fan out messages to large number of suscriber endpoints - Multiple recipients can be grouped using Topics - One topic can support deliveries to multiple endpoint types - Simple APIs & easy integration w/ applications - Flexible message delivery over multiple transport protocols
34
What are Amazon SNS subscriber endpoints? ## Footnote **Amazon SNS**
- SQS queues - Lambda functions - HTTP/S webhooks - Mobile push - SMS - Email
35
What is a **Topic**? ## Footnote **Amazon SNS**
*Access Point* for allowing recipients to dynamically suscribe for identical copies of same notification
36
What are **AWS Step Functions**? ## Footnote **Amazon SNS**
Used to build distributed applications as series of steps in visual workflow - Quickly build & run state machines to execute steps of your application
36
What are features of **SNS** + **SQS Fan-Out** ## Footnote **Amazon SNS**
- You can suscribe many SQS queues to SNS topic - SQS manages subscription & any necessary permissions - When you publish message to topic, SNS sends message to every subscribed queue
37
How do AWS Step Functions work? ## Footnote **Amazon SNS**
1. Define steps of your workflow in **JSON-based Amazon States Language** - visual console automatically graphs each step in order of execution 2. Start execution to visualize & verify application steps are working. - **Operates & scales** steps of application & underlying compute for you to help ensure your application executes reliably under increasing demand
38
What is **API Gateway**? ## Footnote **Amazon SNS**
Used for creating, publishing, maintaining, monitoring, & securing REST, HTTP, & WebSocket APIs at any scale.
39
What are API Gateway Deployment Types & Their Benefits? ## Footnote **Amazon SNS**
- **Edge-Optimized Endpoint** - Reduced latency for requests from around world - **Regional Endpoint**: - Reduced latency for requests that originate in same region - Can also configure your own CDN & protect WAF - **Private Endpoint** - Securlty expose REST APIs only to other services w/in VPC or connect via Direct Connect
40
What are **API Gateway Integration** Types? ## Footnote **Amazon SNS**
- **Lambda function** - Lambda proxy integration - Lambda custom integration - **HTTP Endpoint** - HTTP proxy integration - HTTP custom integration - **AWS Service Action** - Only with **non-proxy type** only
41
How does **API Gateway - Caching** work? ## Footnote **Amazon SNS**
- Add caching to API calls by provising an Amazon API Gateway cache & specifying its size in gigabytes - Allows you to cache endpoint's response - Caching can reduce number of calls to backend & improve latency of requests to API
42
What features does **API Gateway - Throttling** have? ## Footnote **Amazon SNS**
- Sets limit on steady-state rate & burst of request submissions against all APIs in your account - Limits: - Default API Gateway limits steady-state request rate to 10K requests per second - Maximum concurrent requests is 5K requests across all APIs w/in AWS account. - If you go over 10K requests per second or 5K concurrent requests you'll receive *429 Too Many Requests* error response - Upon catching such exceptions, client can resubmit failed requests in way that is rate limiting, while complying w/ API Gateway throttling limits.