Severless - Lambda, DynamoDB, API Gateway, Cognito Flashcards

1
Q

10 Serverless products in AWS?

A
  • AWS Lambda
  • DynamoDB
  • AWS Cognito
  • AWS API Gateway
  • Amazon S3
  • AWS SNS & SQS
  • AWS Kinesis Data Firehose
  • Aurora Serverless
  • Step Functions
  • Fargate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  • Virtual functions – no servers to manage!
  • Limited by time - short executions
  • Run on-demand
  • Scaling is automated!
A

Amazon Lambda

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

With Lambda, Increasing ___________ will also improve ________ and network!

A

RAM
CPU

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

With Lambda, is it Easy to get more resources per functions?

A

YES (up to 10GB of RAM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  • The container image must implement the Lambda Runtime API
  • ECS / Fargate is preferred for running arbitrary Docker images
A

Lambda Container Image

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

AWS Lambda Limits are _______?

A

per region

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

AWS Lambda Execution - Memory allocation

A

128 MB – 10GB (1 MB increments)

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

AWS Lambda Execution - Maximum execution time

A

900 seconds (15 minutes)

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

AWS Lambda Execution - Environment variables

A

(4 KB)

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

AWS Lambda Execution - Disk capacity in the “function container” (in /tmp)

A

512 MB to 10GB

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

AWS Lambda Execution - Concurrency executions

A

1000 (can be increased)

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

AWS Lambda Deployment - Lambda function deployment size (compressed .zip)

A

50 MB

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

AWS Lambda Deployment - Size of uncompressed deployment (code + dependencies)

A

250 MB

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

AWS Lambda Deployment - Can use the ___________ directory to load other files at startup

A

/tmp

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

AWS Lambda Deployment - Size of environment variables

A

4 KB

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

What are the 2 types of Edge Functions that CloudFront provides for Lambda??

A

CloudFront Functions
Lambda@Edge

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

Lambda Customization At The Edge … do you need to manage any servers?

A

NO, They are deployed globally

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

What are 10 use cases for CloudFront Functions & Lambda@Edge

A
  • Website Security and Privacy
  • Dynamic Web Application at the Edge
  • Search Engine Optimization (SEO)
  • Intelligently Route Across Origins and Data Centers
  • Bot Mitigation at the Edge
  • Real-time Image Transformation
  • A/BTesting
  • User Authentication and Authorization
  • User Prioritization
  • User Tracking and Analytics
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q
  • Lightweight functions written in JavaScript
  • For high-scale, latency-sensitive CDN customizations
  • Sub-ms startup times, millions of requests/second
  • Used to change Viewer requests and responses:
    • Viewer Request: after CloudFront receives a request from a
      viewer
    • Viewer Response: before CloudFront forwards the response to
      the viewer
  • Native feature of CloudFront (manage code entirely within CloudFront)
A

CloudFront Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q
  • Lambda functions written in NodeJS or Python
  • Scales to 1000s of requests/second
  • Used to change CloudFront requests and responses:
    • Viewer Request – after CloudFront receives a request from a
      viewer
    • Origin Request – before CloudFront forwards the request to the
      origin
    • Origin Response – after CloudFront receives the response from
      the origin
    • Viewer Response – before CloudFront forwards the response to
      the viewer
  • Author your functions in one AWS Region (us-east-1), then CloudFront replicates to its locations
A

Lambda@Edge

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

Look at Slide 458

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

Use Cases:
* Cache key normalization
* Transform request attributes (headers, cookies, query strings,
URL) to create an optimal Cache Key
* Header manipulation
* Insert/modify/delete HTTP headers in the
request or response
* URL rewrites or redirects
* Request authentication & authorization
* Create and validate user-generated tokens (e.g., JWT) to
allow/deny requests

A

CloudFront Functions

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

Use Cases:
* Longer execution time (several ms)
* Adjustable CPU or memor y
* Your code depends on a 3rd libraries (e.g., AWS SDK to access other AWS services)
* Network access to use external ser vices for processing
* File system access or access to the body of HTTP requests

A

Lambda@Edge

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

By default .. where is your Lambda Function launched?

A

outside your own VPC

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

Lambda in VPC

A
  • You must define the VPC ID, the Subnets and the Security Groups
  • Lambda will create an ENI (Elastic Network Interface) in your subnets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Lambda by default

A
  • By default, your Lambda function is launched outside your own VPC (in an AWS-owned VPC)
  • Therefore, it cannot access resources in your VPC (RDS, ElastiCache, internal ELB…)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What must you do to connect a Lambda function to RDS Proxy?

A

The Lambda function must be deployed in your VPC, because RDS Proxy is never publicly accessible

27
Q
  • Improve scalability by pooling and sharing DB
    connections
  • Improve availability by reducing by 66% the failover time and preserving connections
  • Improve security by enforcing IAM authentication and storing credentials in Secrets Manager
A

RDS Proxy

28
Q

Which RDS support Invoking Lambda?

A

RDS for PostgreSQL and Aurora MySQL

29
Q
  • Must allow outbound traffic to your Lambda function from within your DB instance (Public, NAT GW,VPC Endpoints)
  • DB instance must have the required permissions to invoke the Lambda function (Lambda Resource-based Policy & IAM Policy)
A

Invoking Lambda from RDS & Aurora

30
Q
  • Notifications that tells information about the DB instance itself (created, stopped, start, …)
  • You don’t have any information about the data itself
  • Subscribe to the following event categories: DB instance, DB snapshot, DB Parameter Group, DB Security Group, RDS Proxy, Custom Engine Version
  • Near real-time events (up to 5 minutes)
  • Send notifications to SNS or subscribe to events
    using EventBridge
A

RDS Event Notifications

31
Q

DynamoDB - Fully managed, highly available with replication __________?

A

across multiple AZs

32
Q
  • Scales to massive workloads, distributed database
  • Millions of requests per seconds, trillions of row, 100s of TB of storage
  • Fast and consistent in performance
  • Integrated with IAM for security, authorization and administration
A

DynamoDB

33
Q

How fast and consistent in performance is DynamoDB?

A

(single-digit millisecond)

34
Q

Does Dynamo DB have auto-scaling capabilities?

A

YES

35
Q

Is DynamoDB always available?

A

YES

36
Q

What are the 2 types of Table Classes in DynamoDB

A

Standard
Infrequent Access (IA)

37
Q

DynamoDB is made of _______?

A

Tables

38
Q

Each DyanmoDB table has a __________ (must be decided at creation time)

A

Primary Key

39
Q

Each DyanmoDB table can have __________ number of items

A

an infinite

40
Q

Each DynamoDB item has ____________

A

attributes

41
Q

Can item attributes be added over time?
Can item attributes be null?

A

Yes
Yes

42
Q

What is the maximum size of a DynamoDB item?

A

400KB

43
Q

Which data types are supported in DynamoDB?

A
  • Scalar Types – String, Number, Binary, Boolean, Null
  • Document Types – List, Map
  • Set Types – String Set, Number Set, Binary Set
44
Q

Therefore, in DynamoDB you can _______?

A

rapidly evolve schemas

45
Q

DynamoDB – Read/Write Capacity Modes (2)

A

Provisioned Mode (default)

46
Q
  • You specify the number of reads/writes per second
  • You need to plan capacity beforehand
  • Pay for provisioned Read Capacity Units (RCU) & Write Capacity Units (WCU)
  • Possibility to add auto-scaling mode for RCU & WCU
A

Provisioned Mode (default)

47
Q
  • Read/writes automatically scale up/down with your workloads
  • No capacity planning needed
  • Pay for what you use, more expensive ($$$)
  • Great for unpredictable workloads, steep sudden spikes
A

On-Demand Mode

48
Q
  • Fully-managed, highly available, seamless in- memory cache for DynamoDB
  • Help solve read congestion by caching
  • Doesn’t require application logic modification (compatible with existing DynamoDB APIs)
A

DynamoDB Accelerator (DAX)

49
Q

What is DynamoDB Accelerator (DAX) latency for cached data?

A

Microseconds

50
Q

What is DynamoDB Accelerator (DAX) TTL for cache (default)

A

5 minutes

51
Q

Ordered stream of item-level modifications (create/update/delete) in a table

A

DynamoDB – Stream Processing

52
Q

What are 5 uses cases for DynamoDB – Stream Processing

A
  • React to changes in real-time (welcome email to users)
  • Real-time usage analytics
  • Insert into derivative tables
  • Implement cross-region replication
  • Invoke AWS Lambda on changes to your DynamoDB table
53
Q

What are 2 types of DynamoDB – Stream Processing

A

DynamoDB Streams
Kinesis Data Streams (newer)

54
Q
  • 24 hours retention
  • Limited # of consumers
  • Process using AWS Lambda Triggers, or DynamoDB Stream Kinesis adapter
A

DynamoDB Streams

55
Q
  • 1 year retention
  • High # of consumers
  • Process using AWS Lambda, Kinesis Data Analytics, Kineis Data Firehose, AWS Glue Streaming ETL…
A

Kinesis Data Streams (newer)

56
Q
  • Make a DynamoDB table accessible with low latency in multiple-regions
  • Active-Active replication
  • Applications can READ and WRITE to the table in any region
  • Must enable DynamoDB Streams as a pre-requisite
A

DynamoDB Global Tables

57
Q
  • Automatically delete items after an expiry timestamp
A

DynamoDB –TimeTo Live (TTL)

58
Q

DynamoDB –TimeTo Live (TTL) use cases

A
  • reduce stored data by keeping only current items
  • adhere to regulatory obligations
  • web session handling
59
Q

What are 2 types of DynamoDB – Backups for disaster recovery

A

Continuous backups using point-in-time recovery (PITR)
On-demand backups

60
Q

DynamoDB – Backups for disaster recovery
* Full backups for long-term retention, until explicitely deleted
* Doesn’t affect performance or latency
* Can be configured and managed in AWS Backup (enables cross-region copy)
* The recovery process creates a new table

A

On-demand backups

60
Q

DynamoDB – Backups for disaster recovery
* Optionally enabled for the last 35 days
* Point-in-time recovery to any time within the backup window
* The recovery process creates a new table

A

Continuous backups using point-in-time recovery (PITR)

61
Q
  • Works for any point of time int he last 35 days
  • Doesn’t affect the read capacity of your table
  • Perform data analysis on top of DynamoDB
  • Retain snapshots for auditing
  • ETL on top of S3 data before importing back into DynamoDB
  • Export in DynamoDB JSON or ION format
A

Export to S3 (must enable PITR)

62
Q
  • Import CSV, DynamoDB JSON or ION format
  • Doesn’t consume any write capacity
  • Creates a new table
  • Import errors are logged in CloudWatch Logs
A

Import from S3

63
Q
A