DynamoDb Flashcards

1
Q

What is strong consistency read? (Dynamo DB)

A

This is compared to an “Eventually Consistent Read”. Strong means it will return the last write’s value where eventually might include stale data.

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

What are the downsides of using “Strong Consistent Reads”?

A

Higher latency
Not supported on global secondary indexes
Use the most throughput capacity.

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

What do DynamoDb streams do?

A

They capture time ordered changes to items in db tables.

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

What is Dynamo Time To Live (TTL)?

A

Defines a per item time stamp that determines when an item can be deleted.
Scenarios:
Delete user info if there account is dormant for so long.
Keep data back up per regulatory requirements, then delete after expires.
This is a free feature.

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

What is Dynamo Accelerator (DAX)?

A

A managed in memory cache that sits in front of DynamoDB.

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

What are RCU’s?

A

Read Capacity Unit.

1 RCU can read up to 4k item, “strong consistency read” every second.

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

What are WCU’s

A

Write Capacity Unit.
1 WCU can write up to 1k item every second.
Example: a 2k item would require 2 WCU every second.

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

What is a projection expression?

A

It is a string (aka like a query) that defines the attributes that you are trying to retrieve.

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

What is the difference between a query, scan, getItem, and, batchGetItem ?

A

A scan is looking at every record to determine which results to return (does not care about keys). Can only return 1MB of data back at a time (works like ). Don’t use scan! big bills and performance problems.

Query is specific partition that relates to primary and secondary partition keys (think C# dictionary). So this is a very efficient lookup. Always try and design your db’s to use Query.

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

What is ProvisionedThroughputExceededError?

A

You get this when your request rate is to high. Interesting is that the underlying SDK will retry and eventually succeed when this error is received.

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

What is the difference between batchGetItem and a query?

A

A query uses the partition key and optionally a scan key, and can then optionally filter further by filterExpression. This query is also limited to a partition.

batchGetItem retrieves items by primary key. You have to know the entire primary key. There are two types of primary keys:

  1. Partition key
  2. Partition key, sort key (composite key)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a local secondary index?

A
Provides an alternative sort key.
Must be created at table creation time.
Can create up to 5 per table.
Uses the same partition key.
so it provides you a different view of your data.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a global secondary index?

A

Uses a different partition key.
Creates a new table using the new partition key but keeps the two tables in sync.
This separate table needs to be administered just like your original table (WCU/RCU configured, throttling , ect.. )

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

What problems could a GSI have?

A

Doubles WCU, aka writes to the original table needs to be propagated this table.
Your GSI could return stale data.

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