Domain 3: Development with AWS Services Flashcards
What is the maximum processing time of an AWS Lambda function?
Maximum processing time of 15 mins (cannot be increased)
What is the maximum lambda concurrent executions?
1000 (can be increased by opening a support ticket)
What are Lambda “layers” used for?
Additional code (libraries or custom runtime) in a .zip format for your lambda function to use.
What are some of the serverless AWS services available?
Lambda, dynamodb, API Gateway, S3, SQS, SNS, Step functions and CloudWatch Events
What is Lambda?
A serverless Function-as-a-Service (FaaS) event driven service
How to refer to Lambda function versions?
Unqualified ARN -
arn:aws:lambda:aws-region:acct-id:function:helloworld
Refers to the $LATEST “helloworld” version
Qualified ARN -
arn:aws:lambda:aws-region:acct-id:function:helloworld:42
Refers to version 42 of the helloworld function
What is AWS API Gateway?
AWS serverless service for managing HTTP, SOAP, REST traffic at scale
What languages are supported by AWS Lambda?
Go, C#, Python, Nodejs
What are the main AWS HTTP status codes and their meanings?
2xx - Success
4xx - Client error
5xx - Server side errors
400 - Bad request 401 - Unauthorized 403 - Forbidden/access denied 404 - Resource not found 409 - Conflict 429 - TooManyRequests
500 - Internal Server Error
503 - Service is unavailable
What are the DynamoDB primary key types?
Partition key - Unique item attribute
Composite key - Partition + sort key (partition and sort key combo have to be unique)
What are the different types of a DynamoDB secondary index?
Local Secondary Index
- Same partition key as primary but different sort key
- Can only create at same time table is created
Global Secondary Index
- Different partition and sort key
- Create at any time
- Eventual consistency only
- Own provisioned WCU/RCU
What is the quota for secondary indexes per table?
5 Local secondary indexes
20 Global secondary indexes per table (can be increased)
What is a WCU and RCU?
1 WCU = 1 x 1 kB write per second
1 RCU = 1 x 4 kB strongly consistent reads per second OR
2 x 4 kB eventually consistent reads per second
What are some of the ways to reduce a query time with dynamodb?
- –projection-expression : To only retrieve the attributes of each item that is needed
- Increase the WCU/RCU
- –page-size : To paginate the number of items per page
What are some of the ways to increase a scan speed to dynamodb?
- –projection-expression : To only retrieve the attributes of each item that is needed
- Increase the WCU/RCU
- –page-size : To paginate the number of items per page
- Performing a parallel scan on the dynamodb table
What are the supported documents of a dynamodb table?
HTML, XML or JSON
How is access managed to dynamodb?
IAM policies, access can be granted on a per item basis as well
What are the main db caching services?
DAX - DynamoDB accelerator, only for dynamodb
Elasticache - In memory caching
Both sit between the application and the database
What is the Lazy Loading caching strategy?
Lazy Loading - Loads data into the cache only when necessary
- Set the TTL to reduce stale data
- Little wasted resources
What is the “Write through” caching strategy?
Adds or updates data to the cache whenever data is written to the db
- Write penalty
- Wasted resources when data isn’t read
How does dynamodb support ACID?
DynamoDB transactions: Multiple reads or writes which either fails or succeeds
What is DynamoDB streams?
A time ordered sequence of item level modifications on a dynamodb table which can trigger a Lambda function
Data is stored for 24 hrs
Before and after item images can be captured
What is EFS?
EFC - Elastic File System: Simple and scalable file storage to be used with EC2
What is AWS RDS?
AWS Relational Database service
How to enable encryption on an AWS RDS instance?
Create a snapshot and deploy that snapshot encrypted
What are the main in-memory elasticache methods?
Memcached & Redis for sub-millisecond latency with in-memory caching
What are the main differences between Redis & Memcached?
Memcached is great for simplicity, while Redis is great for persistence, complex data structures and ACID transactions
What are the main AWS DynamoDB commands & their meanings?
aws dynamodb get-item # Get a single item in a table
aws dynamodb put-item # Write a single item
aws dynamodb batch-get-item # Get multiple items
aws dynamodb batch-write-item # Write multiple items
A DynamoDB call returns a “unprocessedKeys” value to your query, what are some of the reasons this could be and how are the remediated?
- The total data returned exceeds 16 MB
- paginate your returned results - The table provisioned throughput has been exceeded
- Retry the remaining batch get operation with the exponential backoff algorithm
What are the attribute types of a DynamoDB item?
String (S), Number (N) or Binary (B)
What are the main AWS messaging services?
SQS - Simple Queue Service
SNS - Simple Notification Service
SES - Simple Email Service
What are the SQS queue types and their uses?
Standard - Not guaranteed to be ordered and may be delivered more than once but most efficient
FIFO - Guaranteed to be ordered and delievered only once
What is the maximum message size in a SQS queue?
256 kB
How do you deliver messages that are very large with SQS?
Using S3 with the “Extended Client Library for Java” up to a maximum of 2 GB
What is the SQS visibility timeout?
It is a period of time from when a consumer consumes a message during which other consumers cannot receive and process the message.
Once the consumer has successfully processed a message it should delete it from the queue
What is the SQS visibility timeout default value?
30 s
What is the SQS visibility timeout minimum value?
0 s
What is the SQS visibility timeout maximum value?
12 hrs
What is the SQS message retention period?
The time a message is permitted to remain in a SQS queue
What is the SQS message retention period default value?
4 days
What is the SQS message retention period minimum value?
60 s
What is the SQS message retention period maximum value?
14 days
What is the AWS SQS delay queue?
Allows the producer of message to make a message invisible on the queue for a period of time before a consumer can read it
What is the AWS SQS minimum SQS delay time?
0 s
What is the AWS SQS default SQS delay time?
0 s
What is the AWS SQS maximum SQS delay time?
15 mins
What is the main difference between SQS & SNS?
SQS is pull-based & SNS is push-based
What is SNS?
A pub/sub aws managed service
What are the main protocols of SNS?
SQS, Lambda, HTTP, email, mobile push notifications & mobile SMS
How can you deliver to multiple SQS queues?
With fanout - Publish to an SNS topic with SQS queues as the subscribers
What is SQS long polling and short polling?
Short polling immediately returns a response if the queue is empty, while long polling will wait a given time (max 20 s) for a message to appear.
Long polling is cheaper and more efficient CPU wise
What is the best way to prioritise messages with SQS?
Have a priority queue and a lower priority queue.
Have the client poll the priority queue and if it is empty check the lower priority queue.
What is DynamoDB TTL?
Time To Live defines an expiry time for your data, once item is expired the item is marked for deletion, item will be deleted within 48 hrs
Automatically removes data which is no longer relevant.
Reduces cost.
What is ECS?
Elastic Container Service - A managed container orchestration service which supports:
docker & windows containers
What is AWS Fargate?
AWS Fargate is a serverless compute engine for containers which is integrated with ECS & EKS
What is EKS?
Amazon Elastic Kubernetes Service - gives you the ability to start, run & scale Kubernetes applications for managing multiple containers
What is ECR?
Elastic Container Registry - A registry of container images
ECS connects to ECR to deploy your application
What are the deployment options for containers?
ECS can run your containers on either:
Clusters of virtual machines
Fargate for serverless containers
What is a container?
A container is a virtual operating environment with everything the software needs to run
Outline the steps of deploying a docker application with CodeCommit, CodeBuild & ECS
1 Application code is stored in CodeCommit with the “buildspec.yml” & “Dockerfile” at the root of the directory
- CodeBuild uses the CodeCommit repo together with the buildspec.yml file to create the Docker image
- CodeBuild pushes the docker image to the ECS
What is the docker command for building a docker image?
docker build -t myimagerepo (local file path of your docker application)
What is the docker command for tagging a docker image?
docker tag myimagerepo:lastest (account #).dkr.ecr.(aws region).amazonaws.com/myimagerepo:latest
What is the docker command for pushing a docker image?
docker push (account #).dkr.ecr.(aws region).amazonaws.com/myimagerepo:latest
How can you configure API gateway?
Swagger (.yml) configuration files, can also be used with an SDK