DynamoDB Flashcards

1
Q

Define Eventual Consistent Reads

A

Consistency across all copies of data is usually reached within a second.

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

Define Strongly Consistent Reads

A

A read that results in all writes that were successful prior to the read

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

DynamoDB tables are composed of ___________ and _____________.

A

Items (rows) and Attributes (data)

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

What are the two types of primary keys available?

A

Single attribute - Partition Key

Composite - Partition and Sort Key

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

True or False: Single attribute primary keys can be shared between items

A

False

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

How is the partition key used by DynamoDB?

A

The partition key is hashed to determine the partition the data is stored in.

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

True or False: Items with a composite primary key can share partition keys.

A

True. They must have a different sort key

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

Local Secondary Index has the ________ partition key and ________ sort key.

A

Same.

Different.

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

Global Secondary Index has the ________ partition key and ________ sort key.

A

Different.

Different.

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

When can a Local Secondary Index be created?

A

Only at table creation.

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

Can a Local Secondary Index be modified or removed?

A

No.

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

When can a Global Secondary Index be created?

A

At table creation or added later.

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

What are DynamoDB Streams?

A

They capture any modifications to the DynamoDB table.

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

What is the difference between Query and Scan in DynamoDB?

A

Query finds items by primary key attribute values. A scan examines every item in the table.

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

Which is more effecient: Query or Scan?

A

Use query operations.

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

How is read and write throughput measured in DynamoDB?

A

Capacity units

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

One write capacity unit is equal to _______ write of ________ KB.

A

one

1KB.

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

One read capacity unit for eventual read consistency is equal to _____ read(s) of ______ KB per second

A

two.

4KB.

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

One read capacity unit for strong read consistency is equal to _____ read(s) of ______ KB per second

20
Q

An application needs to read an item that is 13KB in size 20 times per second with eventual consistent reads. What should the read capacity be set to?

A

Calculate the read capacity units. Multiply by throughput. Divide by two for eventually consistent reads.

13 rounded up to nearest multiple of 4 = 16
16KB / 4KB = 4
4 * 20 = 80
80 / 2 = 40

21
Q

An application needs to write an item that is 12.5KB in size 30 times per second. What should the write capacity be set to?

A

Calculate the write capacity units required. Multiply by throughput.

12.5KB / 1KB = 13 (round up)
13 * 30 = 390

22
Q

What error codes would be seen if you go over provisioned throughput?

A

HTTP status 400: ProvisionedThroughputExceededException

23
Q

What is a conditional write?

A

Idempotent transaction. Duplicate requests will not be processed

24
Q

True or False: Atomic counters are idempotent.

A

False. the counter increments every time you call UpdateItem

25
What API call should you use to read multiple items?
BatchGetItem
26
How many items can be retrieved by a BatchGetItem API call?
Up to 100 and 16MB in size.
27
True or False: BatchGetItem can retrieve items from multiple tables.
True
28
What is DynamoDB?
fully managed NoSQL database
29
What is the limit size of an item?
The total size of an item, including attribute names and attribute values, cannot exceed 400KB.
30
What is the response limit for a Query API call?
1MB
31
What data types does DynamoDB support?
Number, String, Binary, Boolean. Collection: Number, String, Binary, List, Map
32
True or False. DynamoDB has a 5PB storage limit.
False
33
What application patterns work best with DynamoDB autoscaling?
Uniform and predictable with sustained high/low throughput usage.
34
What is a global secondary index?
An index that contain a partition or partition-and-sort key that can be different from the table's primary key.
35
What is the difference between a local and global secondary index?
A local index has the same partition key as the table but a different sort key. It is scoped to the table partition that has the same partition key. A global index can be different from those on the table. Queries can span all items in a table across all partitions
36
When should you use a global secondary index?
If you need to track a relationship between values that have a lot of different values.
37
True or False: Global Secondary Index keys must be unique.
False
38
What is the consistency model for a Global Secondary Index?
Eventual consistency
39
True or False: A Global Secondary Index must be provisioned for its own read and write capacity.
True
40
Can a Local Secondary Index be deleted?
No
41
True or False: A Local Secondary Index must be provisioned for its own read and write capacity.
False
42
What data types can be indexed?
All scalar types. Number, String, Binary
43
What are item collections?
A group of items that share the same partition key across a table and all of its local secondary indexes. Traditionally called shards or partitions.
44
True or False: Item Collections must be created manually
False.
45
Is there a limit size for an Item Collection?
Yes. 10GB
46
What is Reserved Capacity?
A billing feature that allows you to obtain discounts on provisioned throughput.
47
What is the smallest amount of reserved capacity that can be purchased?
100 capacity units