Serverless Overview Flashcards

1
Q

What is Cognito?

A

An aws server for simplified user authentication and management for web and mobile applications.

It allows developers to add user sign-up, sign-in, and access control to their apps.

It uses token exchanges to validate users.

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

What are noSQL databases for?

A

For data that doesn’t have a specific structure.

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

What is API Gateway?

A

A service for creating and using APIs. Great for accessing data from the front end like a webserver to the aws backend services like lambda, S3 or any database service like dynamodb.

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

Why use lambda compared to EC2?

A

In EC2 resources run coninuously. In Lambda you only pay for the time lambda funcions are in use. Lambda functions are called, then start and stop. Once stopped you don’t pay for anything until the function is called again.

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

What do you pay for in lambda?

A

Pay per request and compute time

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

How does API Gateway interact with lambda?

A

It calls lambda functions, from a web app for example.

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

How can lambda integrate with event bridge?

A

With eventbridge you can schedule events recurrently, for example every 1 hour. With this event you can trigger a lambda function.

This way you can do a million things. It’s similar to using CRON, but serverless.

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

What is Memory for a lambda function?

A

The power you give to a lambda function in memory, network and cpu is represented by what you configure for the function in the memory field. If you provision more memory your lambda function will run faster, but you will get billed more.

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

How can you prevent a lambda function from running too long and cost you unwanted money?

A

With a timeout configured at the function.

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

What is the limit in storage for a lambda function?

A

10Gb in a temp folder in the function

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

What is lambda snapstart?

A

Only for java 11, lambda preinitializes the function so it runs up to 10 times faster.

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

What is cloudfront functions and lambda@edge?

A

A lambda code that you attach to cloudfront distributions.
Runs close to your users to minimize latency.

They are used to manipulate the code of the website that is presented by cloudfront to the users in a specific region.

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

What do you need to know regarding lambda and VPC?

A

You need to enable access to a VPC in lambda function creation, because by default lambda runs on the aws VPC and doesn’t have access to your resources.

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

What is recommended to do when running lambda functions against an RDS database?

A

To use an RDS proxy. And give access to lambda function to your private VPC, because RDS proxy is NEVER public.

If lambda functions directly access your database, they may open too many connections introducting high load and potencial issues to your database.

With an RDS Proxy you keep your database unaffected.

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

What are the distinguishing characteristics of dynamodb?

A

multi az HA.
It’s non relational
It’s cloud native (aws propietary) so it’s fully managed
Scales massively
fast and consistent performance (single digit ms)
No maintenance, always available.

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

How do you create a DynamoDB database?

A

Yo dont create it, it’s already there. You just create tables for data.

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

What is dynamoDB made of?

A

Tables.

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

What is a primary key in dynamodb?

19
Q

What are dynamo db tables composed of?

A

Rows of items.
Each item has its own attributes, which are columns.

20
Q

How many items can a dynamodb table have?

21
Q

What is the maximum size of a dynamodb item?

22
Q

Is dynamo db good for static schemas?

A

No. RDS better.

23
Q

Is dynamodb good for rapidly evolving schemas?

A

YES! ideal for this, contrary to RDS which is more strict with its data types.

24
Q

What are the 2 modes of dynamodb for throughput scaling?

A

Provisioned mode: Choose what capacity to pay for. Has auto scaling for reads and writes but doesn’t scale fast enough for sudden spikes.

On Demand: Pay for what you use. Can scale a lot very quickly. Great for unpredictable workloads with sudden spikes.

25
Q

How do you solve read congestion in dynamodb?

A

With dynamodb accelerator (DAX). It’s a caching feature. Introduces microsecond latency for reads of cached data.

26
Q

What is Dynamodb global table?

A

A table that spans multiple regions. You can set up 2 way replication for a table between 2 regions. Writes to either table are written to both tables.

The objective is to make a dynamodb table accessible with low latency in multiple regions.

27
Q

What is the table TTL?

A

All items in a table have a TTL which you have to set.

28
Q

How can you back up dynamodb?

A

You have continuous backups for the last 35 days, with point in time recovery to any point within the backup window.

And you have on demand backups. These are full backups for long term retention, you can delete manually.

29
Q

What are the integrations of dynamodb with s3?
Use cases?

A

You can export a table into s3, usint the point in time recovery backups. Useful for data analytics of your dynamodb tables.

Useful to retain data for auditing.

Useful to transform data then import back to dynamo. (You can also import to dynamodb in a new table).

30
Q

What does API Gateway do?

A

It lets you create rest apis for external clients to be able to use aws services through these apis. Clients talk to api gateway, then api gateway proxies requests to the service.

It handles all AWS service APIs to external clients. Meaning you can allow an external client to use for example kinesis data streams through the api gateway, without giving them access to your aws account. API Gateway works through HTTP for example.

31
Q

What can you expose with API Gateway?

A

Lambda, any HTTP endpoint, or any aws service.

32
Q

What are the API Gateway endpoint types?

A

Edge-Optimized: Requests are routed through aws cloudfront edge locations. (Improved latency over long distances). For global clients. The api gateway still lives in one region.

Regions: Doesn’t use cloudfront edge locations. For clients within same region.

Private: Only accessible through private VPC. Uses eni.

33
Q

What features do you have with API Gateway?

A

API Gateway + Lambda (No infrastructure to manage).
Websocket protocol support (Real time streaming).
Multiple environments: Dev, test, prod…
Security features: IAM, Cognito, custom.

34
Q

What are AWS Step functions?

A

Its a service used to build a visual workflow (diagram), of lambda functions. You can use it to decide a workflow of what to execute in different results of lambda functions.

TLDR: Orchestration workflow of lambda functions.

35
Q

What can aws step functions integrate with?

A

Lambda, EC2, ECS, on premises servers, api gateway, SQS, etc.

36
Q

What is human approval in step functions?

A

You can implement human approval. This means, a function goes on up until a certain point, in which it asks for human approval. If you say yes it continues a certain way, if you say no it continues a different way.

37
Q

What is cognito user pools?

A

one of two features of cognito.

Creates a serverless database of users. These users are to login into web and mobile apps.
It has user and passwor, mfa, email and phone verification, password reset, google, facebook for login. etc.

User pools can authenticate against api gateway and lambda.
User pools can authenticate against ALB and its target.

38
Q

What is cognito identity pools?

A

This is federated identities: It gives temporary aws credentials to users.

Users in this case can be cognito user pools themselves, or 3rd party logins, etc.

These since they are temporary aws users, have iam policies applied. These are defined in cognito

39
Q

What can you cache with API Gateway?

A

You can cache Lambda function calls that always throw the same result. This induces cost savings to lambda.

40
Q

How can you save money with a dynamodb high read database?

A

Using DAX cache. Most requested entries will be cached thus reducing the cost of reads of the database.

41
Q

What is a dynamodb streams use case?

A

To invoke a lambda function to do something.

For example send an email with SES like a welcome email to a new user of a website.

Enabling DynamoDB Streams activates a table changelog that lets you run lambda functions related to dynamodb item changes.

42
Q

You have created a DynamoDB table in ap-northeast-1 and would like to make it available in eu-west-1, so you decided to create a DynamoDB Global Table. What needs to be enabled first before you create a DynamoDB Global Table?

A

DynamoDB Streams. It enables a changelog you can use to enable dynamodb global table.

43
Q

You would like to create an architecture for a micro-services application whose sole purpose is to encode videos stored in an S3 bucket and store the encoded videos back into an S3 bucket. You would like to make this micro-services application reliable and has the ability to retry upon failures. Each video may take over 25 minutes to be processed. The services used in the architecture should be asynchronous and should have the capability to be stopped for a day and resume the next day from the videos that haven’t been encoded yet. Which of the following AWS services would you recommend in this scenario?

s3 + lambda
sns + ec2
sqs + ec2
sqs + lambda

A

sqs + ec2

Amazon SQS allows you to retain messages for days and process them later, while we can take down our EC2 instances.

44
Q

You are running a photo-sharing website where your images are downloaded from all over the world. Every month you publish a master pack of beautiful mountain images that are over 15 GB in size. The content is currently hosted on an Elastic File System (EFS) file system and distributed by an Application Load Balancer and a set of EC2 instances. Each month, you are experiencing very high traffic which increases the load on your EC2 instances and increases network costs. What do you recommend to reduce EC2 load and network costs without refactoring your website?

A

Create a Cloudfront Distribution