Serverless Flashcards

1
Q

Serverless

A

*No infrastructure to provision or manage
*No servers to provision, operate, or patch
*Scales automatically by unit of consumption, rather than by server unit
*Pay-for-value billing model (pay for the unit, rather than by server unit)
*Built-in availability and fault tolerance
*No need to architect for availability because it is built into the service

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

AWS Serverless Portfolio

A

1.Lambda
2. Fargate

  1. API Gateway
  2. S3
  3. DynamoDB
  4. Aurora Serverless
  5. Congnito
  6. SNS
  7. SQS
  8. Step Functions
  9. Kinesis
  10. Athena
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

API Gateway

A

Create an entry point for your applications.
*Process up to hundreds of thousands of concurrent API calls.
*Choose internet-facing or internal only.

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

Types of tasks API gateway handles

A

traffic management, authorization and access control,
monitoring, and API version management.

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

What are things you can do with API Gateway

A

With
API Gateway, you can do the following:
*Host and use multiple versions and stages of your APIs.
*Create and distribute API keys to developers.
*Use Signature Version 4 (SigV4) to authorize access to APIs.
*Use RESTful or WebSocket APIs.

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

Features of API Gateway

A

Creates a unified API frontend for multiple
microservices

Provides distributed denial of service (DDoS)
protection and throttling for your backend

Authenticates and authorizes requests to a backend

Throttles, meters, and monetizes API usage by
third-party developers

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

What detailed metrics can API Gateway send to CloudWatch

What other type of logging can you do with API Gateway

A

*Number of API calls
*Latency
*Integration latency
*HTTP 400 and 500 errors

You can also activate access logging to log who has accessed your API and how they accessed it.

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

Amazon SQS

A

Fully managed message queueing service

Stores messages until they are processed and deleted

Acts as a buffer between senders and receivers

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

What makes SQS a managed service

A

requires no administrative overhead

massive scale, processing billions of messages per day

stores all message queues and messages within a single, highly available AWS Region with multiple redundant Availability Zones

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

Unique access control features of SQS

A

Developers can securely share SQS queues anonymously or with specific AWS accounts. You can also restrict queue sharing by IP address and time of day.

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

Streaming Single Instruction Multiple Data (SIMD) Extensions (SSE)

A

Streaming Single Instruction Multiple Data (SIMD) Extensions (SSE) protects the contents of messages in SQS queues using keys managed in AWS KMS.
SIMD Extensions encrypts messages as soon as Amazon SQS receives them. The messages are stored in encrypted form, and Amazon SQS decrypts messages only when they are sent to an authorized consumer

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

SQS queue provides the following benefits

A

*Loose coupling – With Amazon SQS, you can decouple preprocessing steps from compute steps and postprocessing steps. Using asynchronous processing isolates the producer logic into its own component separate from the consumer logic.

*Failure tolerance – In the event of an application exception or transaction failure, the processing can be retried. Once the maximum number of retries is reached, SQS can redirect the message to dead-letter queue .

*Absorbs spikes – An Amazon SQS queue makes the system more resilient. The queue acts as a buffer to
absorb spikes in traffic. This gives your application additional time to complete scale-out actions. It is also cost effective because you don’t need to provision as much idle compute to absorb spikes.

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

dead-letter queue

A

dead-letter queue where you can reprocess or debug it later

messages that cannot be processed by the consumer queue

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

SQS use cases

A

*Work queues – Decouple components of a distributed application that might not all process the same amount of work simultaneously. You can choose a standard queue or a first-in-first-out (FIFO) queue depending on the requirements of your application.

*Buffering and batch operations – Add scalability and reliability to your architecture and smooth out
temporary volume spikes without losing messages or increasing latency.

*Request offloading – Move slow operations off of interactive request paths by enqueueing the request.

*Auto scaling instances – Use SQS queues to help determine the load on an application. When combined with auto scaling, you can scale the number of Amazon EC2 instances in or out, depending on the volume of traffic.

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

Amazon SQS offers two types of message queues.

A

Standard queues

FIFO queues

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

Standard queues

A

support at-least-once message delivery and provide best-effort ordering.

Messages are generally delivered in the same order in which they are sent. However, because of the highly distributed architecture, more than one copy of a message might be delivered out of order.

can handle an early unlimited number of API calls per second. You can use standard message queues if your application can process messages that arrive more than once and out of order.

17
Q

FIFO queues

A

are designed to enhance messaging between applications when the order of operations and events
is critical or where duplicates can’t be tolerated.

FIFO queues also provide exactly-once processing, but have a limited number of API calls per second.

18
Q

Visibility timeout

A

You can configure the SQS queue’s
visibility timeout setting to make that message invisible to other consumers for a period of time. This helps to prevent another consumer from processing the same message. The default visibility timeout is 30 seconds. The consumer deletes the message once it completes processing the message.
If the consumer fails to delete the message before the visibility timeout expires, it becomes visible to other consumers and can be processed again.

19
Q

Short Polling

A

An SQS queue with short polling:
*Sends a response to the consumer immediately after receiving a request, providing a faster response
*Increases the number of responses and therefore costs

20
Q

Long Polling

A

An SQS queue with long polling:
*Does not return a response until at least one message arrives or the poll times out
*Provides less frequent responses but decreases costs

21
Q

Type of polling available with SQS

Which is preferred and why

A

You can configure an Amazon SQS queue to use either short polling or long polling.

Depending on the frequency of messages arriving in your queue, many of the responses from a queue using short polling could just be reporting an empty queue. Unless your application requires an immediate response to its poll requests, long polling is the preferable option.

22
Q

When should you not use message queues

A

Selecting specific messages -This can
lead to a scenario where there are messages in the queue that no one is polling for and are never consumed.

Large messages -reasonably sized messages (in the tens or hundreds of kilobytes). As message sizes grow, it’s best to use a dedicated storage system

23
Q

Amazon
SNS

A

a web service that helps you to set up, operate, and send notifications from the cloud.

follows the publish subscribe(pub sub) messaging paradigm, with notifications being delivered to clients
using a push mechanism.

24
Q

Describe SNS pub sub

A

a publisher sends a message to the topic.
Amazon SNS matches the topic to a list of subscribers for that topic, and delivers the message to each
subscriber.

Subscribers receive all messages published to their subscribed topics. All subscribers to a topic receive the same messages.

25
Q

Does SNS support encryption, if so how, if not why not?

A

Amazon SNS supports encrypted topics. When you publish messages to encrypted topics, Amazon SNS uses AWS Key Management Service (AWS KMS) keys
to encrypt your messages.

26
Q

Type of SNS subscribers

A

Email/Email J-SON
Mobile text messaging SMS
Mobile push notifications
HTTP/HTTPS
AWS Lambda
Amazon SQS
Kinesis Data Firehose

27
Q

SNS use cases

A

You can receive immediate notification when an event occurs, such as a specific change to your AutoScaling group. (e.g. CloudWatch alarm notification)

You can push targeted news headlines to subscribers by email or SMS.

You can send notifications to an app, indicating that an update is available. (e.g. push notifications)

28
Q

SNS Features

A
  1. Single published message
  2. No recall option
  3. HTTP or HTTPS retry
  4. Standard or FIFO topics
  5. Delivery Policy
  6. messages stored redundantly across multiple servers and data centers
29
Q

SNS vs SQS
1. Message persistence
2. Delivery mechanism
3. Producer and consumer
4. Distribution model

A
  1. SNS - no persistence, SQS - persistence
  2. SNS - Push (passive), SQS - Poll (active)
  3. SNS - pub/sub, SQS - send or recieve
  4. SNS - one to many, SQS - one to one