Merge 2 Flashcards

1
Q

Where is data in DynamoDB stored?

A

SSD Storage

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

Where is DynamoDB spread?

A

across 3 geographically distinct data centers (not AZs)

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

Default consistency model for DynamoDB

A

Eventual Consistent Reads. Strongly consistent reads is the other

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

Eventual Consistent Reads

A

Consistency across all copies of data is usually reached within 1 second. repeating a read after a short time should return the updated data (best read performance)

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

Strongly Consistent Reads

A

returns the result that reflects all writes that received a successful response prior to the read

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

If low latency is important

A

pick Eventual consistent reads. Otherwise, pick strongly consistent reads

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

DynamoDB pricing

A

Provisioned throughput capacity, storage

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

How expensive is DynamoDB?

A

Expensive for writes, cheap for reads

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

Use case for DynamoDB

A

If DB is read-heavy, scalabilty and good performance are important, SQL is not necessary

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

default read and write capacity units when creating a DynamoDB table

A

5, 5

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

can you purchase reserved capacity?

A

Yes, 1 or 3-year terms

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

Item

A

Row

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

Important metrics to know

A

Read capacity Units, Write capacity units (both provisioned/consumed)

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

Is RedShift fully managed?

A

Yes

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

RedShift configuration

A

Single node (160 GB), multi-node

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

Multi node consists of

A

Leader node, compute node

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

Leader node

A

manages client connections and receives queries

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

Compute node

A

store data and perform queries and computations. up to 128 compute nodes

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

Does RedShift organize data by rows or columns?

A

Columns, so improved performance

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

Redshift is fast because

A

Massively Parallel processing, advanced compression

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

RedShift pricing

A

compute node hours,backup, data transfer w/in a VPC

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

RedShift security

A

encrypted in transit (SSL), encrypted at rest (AES-256), redshift takes care of key management by default

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

Redshift availability

A

1 AZ, can restore snapshots to new AZs in case of outage

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

Elasticache can be used for

A

improving application performance/latency/throughput for many read-heavy apps by storing critical pieces of data in memory for low-latency access (social networking, gaming, media sharing, Q/A portals)

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

Memcached

A

memory object caching system

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

Redis

A

open source in-memory key-value store that support data structures such as sorted sets and lists.

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

Elasticache supports

A

Master/slave replication, multi-AZ

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

If a database is under a lot of stress, which service would you use?

A

Elasticache if read heavy and not prone to frequently changing
Redshift if reason for stress is OLAP

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

What is Aurora?

A

MySQL-compatible, relational database engine that combines the speed and availability of high-end commercial databases with the simplicity and cost-effectiveness of open-source databases

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

Performance, Price: Aurora vs MySQL

A

Aurora: 5x better, 1/10 cheaper

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

Aurora scaling

A

start with 10 GB, scales in 10 GB increments to 64 Tb

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

Compute resources scaling

A

up to 32 vCPUs and 244 Gb memory

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

How many copies of Aurora data?

A

2 per AZ, minimum of 3 AZs, so minimum of 6

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

How many copies can be lost w/o affecting availability?

A

2 - write, 3 - read

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

Aurora is self-healing, what is meant by that?

A

data blocks and disks are continuously scanned for errors and repaired automatically

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

2 Aurora replicas

A

Aurora replicas (15), MySQL Read replicas (5)

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

Aurora Replica vs MySQL read replica

which has failover?

A

Aurora read replica has failover, MySql read replica doesn’t

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

Failover logic

A

tier 0 is highest

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

What is SQS?

A

web service that allows you to access a message queue that can be used to store messages while waiting for a computer to process them.distributed queue system that enables web services apps to quickly and reliably queue messages that one component in the app generates to be consumed by another component

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

What is a queue?

A

temporary repository for messages that are awaiting processing

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

Example of SQS:

A

Image is uploaded to web app, web app alerts SQS that image has been uploaded and a job needs to be executed on it. app servers may queue SQS system and notice new job that comes in and access that image and perform a task. app servers will update queue and remove message from the queue

42
Q

What is meant by decoupling/loosely coupling in SQS?

A

If web server goes down, for example, message is still in SQS and app servers not affected

43
Q

T/F: Using SQS, you can decouple the components of an app so they run independently, with SQS easing message management between components.

A

TRUE

44
Q

Can any component of a distributed app store messages in a fail-safe queue?

A

Yes

45
Q

How much text can be contained in a message?

A

256 KB, any format

46
Q

How can a component retrieve messages?

A

with the SQS API

47
Q

The queue acts as

A

a buffer between the component producing and saving data and the component receiving the data for processing.

48
Q

The queue resolves…

A

…issues that arise if the producer is producing work faster than the consumer can process it, or if the producer or consumer are only intermittently connected to the network

49
Q

How many times does SQS deliver each message?

A

at least once

50
Q

How many readers and writers can interact with the same queue?

A

multiple

51
Q

How many components can a single queue interact with?

A

Many, simultaneously.

52
Q

Do components need to coordinate with each other to share the queue?

A

No

53
Q

SQS is engineered to

A

always be available and deliver messages

54
Q

Does SQS guarantee first in first out delivery?

A

No

55
Q

Is order important?

A

No, but you can place sequencing information in each message.

56
Q

Is SQS pull or push?

A

pull

57
Q

sqs visibility timeout

A

how long message will be visible in the queue

58
Q

when does visibility timeout start?

A

when app server picks up the message

59
Q

when would a message be processed/deleted?

A

during visibility timeout period

60
Q

what happens if visibility timeout expires?

A

message will stay in queue and won’t be deleted and another app server will pull it

61
Q

T/F: SQS can be integrated with Auto Scaling

A

True. Useful for when queue gets too large and more app servers can spin up

62
Q

max visibility timeout period

A

12 hours

63
Q

Best design practice

A

design system so that processing a message more than once does not create errors/inconsistencies

64
Q

How is message billing based?

A

64 kb chunks. each chunk billed as one request

65
Q

Cost for requests per month

A

First 1M free, after that it’s 50 cents per million requests

66
Q

How many messages can a request have?

A

Minimum 1 message, maximum 10 messages, up to maximum 256 kb

67
Q

What is SWF?

A

web service that makes it easy to coordinate work across distributed app components

68
Q

SWF enables apps to be designed as…

A

a coordination of tasks

69
Q

Tasks represent

A

invocations of various processing steps in an app which can be performed by executable code, web service calls, human actions, and scripts

70
Q

SQS vs SWF retention period

A

SQS - 14 days, SWF - 1 year

71
Q

SQS vs SWF - APIs

A

SQS - message oriented, SWF - task oriented

72
Q

SQS vs SWF - duplication

A

SWF - task assigned only once, never duplicated
SQS - need to handle duplicated messages, make sure message is processed only once

73
Q

SQS vs SWF - tracking

A

SWF - keeps track of all the tasks and events in an app

SQS - need to implement your own app-level tracking, especially if your app uses multiple queues

74
Q

SWF Actors

A

Workflow Starters, Deciders, Activity Workers

75
Q

Workflow Starters

A

an app that can initiate (start) a workflow. example: e-commerce website when placing an order or a mobile app searching for bus times

76
Q

Deciders

A

control the flow of activity tasks in a workflow execution. if something has finished in a workflow (or fails) a decider decides what to do next

77
Q

Activity Workers

A

carry out the activity tasks

78
Q

What is SNS?

A

web service that makes it easy to set up, operate, and send notifications from the cloud. provides developers w/ a highly scalable, flexible, and cost-effective capability to publish messages from an app and immediately deliver them to subscribers or other apps

79
Q

Common use case for SNS

A

notifies you in case of auto scaling, CloudWatch event

80
Q

push notifications to

A

Apple, Google, Fire OS, and Windows devices, as well as Android devices in China w/ Baidu Cloud Push

81
Q

What can SNS do other than push cloud notifications to mobile devices?

A

deliver notifications by SMS or email, to SQS queues, or to any HTTP endpoint. can also trigger Lambda functions

82
Q

When message published to an SNS topic that has Lambda function subscribed to it

A

Lambda function is invoked with the payload of the published message. the lambda function receives the message payload as an input parameter and can manipulate the info in the message, publish the message to other SNS topics, or send the message to other AWS services

83
Q

SNS allows you to group multiple recipients using

A

topics

84
Q

Topic

A

access point for allowing recipients to dynamically subscribe for identical copies of the same notification.

85
Q

One topic can support deliveries to

A

multiple endpoint types (e.g. group together iOS, Android, SMS)

86
Q

When you publish once to a topic

A

SNS delivers appropriately formatted copies of your messages to each subscriber

87
Q

to prevent messages from being lost

A

all messages published to SNS are stored redundantly across multiple AZs

88
Q

SNS benefits

A

Instantaneous, push-based delivery (EC2 instances do not need to pull) simple APIs and easy integration with apps flexible message deliver over multiple transport protocols pay as you go

89
Q

SNS vs SQS

A

both messaging services, SNS - Push, SQS - Pull

90
Q

SNS pricing

A

50 cents per million SNS requests, 6 cents per 100k notifications over HTTP, 75 cents per 100 notifications over SMS, $2 per 100k notifications over email

91
Q

What is Elastic Transcoder?

A

Media transcoder in the cloud. Converts media files from original source format into different formats that will play on smartphones, PCs, tablets, etc. transcoding presets for popular output formats. pay based on the minutes you transcode, resolution at which you transcode

92
Q

What is API Gateway?

A

Amazon API Gateway is a fully managed service that makes it easy for developers to publish, maintain, monitor, and secure APIs at any scale. With a few clicks in the AWS Management Console, you can create an API that acts as a “front door” for applications to access data, business logic, or functionality from your back-end services, such as applications running on Amazon Elastic Compute Cloud (Amazon EC2), code running on AWS Lambda, or any web application.

93
Q

API gateway architecture

A

User makes a request through API gateway, which triggers a Lambda function or routes request to EC2 instances. That request is then cached at API gateway, so subsequent requests would return the cached endpoint

94
Q

What is API caching?

A

Can enable API caching to cache your endpoint’s response. with caching, you can reduce the number of calls made to your endpoint and also improve the latency of the requests to your API. when you enable caching for a stage, API gateway caches responses from your endpoint for a specified TTL period in seconds. API gateway then responds to the request by looking up the endpoint from the cache instead of making a request to your endpoint

95
Q

What can API gateway do?

A

Low cost and efficient, scales effortlessly (w/o autoscaling groups or EC2 servers but can cause security concerns), you can throttle requests to prevent attacks, connect to CloudWatch to log requests

96
Q

Same origin policy

A

In computing, the same-origin policy is an important concept in the web app security model. Under the policy, a web browser permits scripts contained in a first web page to access data in a second web page, but only if both web pages have the same origin/domain name

97
Q

Cross-Origin Resource Sharing (CORS)

A

CORS is one way the server at the other end (not the client) can relax the same-origin policy.It is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside of the domain from which the first resource was served

98
Q

Error: “Origin policy cannot be read at the remote resource”

A

You need to enable CORS on API gateway

99
Q

T/F: API gateway has caching capabilities to increase performance

A

TRUE

100
Q

T/F: API gateway is low cost and scales automatically.

A

TRUE

101
Q

If you are using Javascript/AJAX that uses multiple domains with API gateway,

A

ensure you have enabled CORS on API Gateway