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

A

one.

4KB.

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
Q

What API call should you use to read multiple items?

A

BatchGetItem

26
Q

How many items can be retrieved by a BatchGetItem API call?

A

Up to 100 and 16MB in size.

27
Q

True or False: BatchGetItem can retrieve items from multiple tables.

A

True

28
Q

What is DynamoDB?

A

fully managed NoSQL database

29
Q

What is the limit size of an item?

A

The total size of an item, including attribute names and attribute values, cannot exceed 400KB.

30
Q

What is the response limit for a Query API call?

A

1MB

31
Q

What data types does DynamoDB support?

A

Number, String, Binary, Boolean. Collection: Number, String, Binary, List, Map

32
Q

True or False. DynamoDB has a 5PB storage limit.

A

False

33
Q

What application patterns work best with DynamoDB autoscaling?

A

Uniform and predictable with sustained high/low throughput usage.

34
Q

What is a global secondary index?

A

An index that contain a partition or partition-and-sort key that can be different from the table’s primary key.

35
Q

What is the difference between a local and global secondary index?

A

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
Q

When should you use a global secondary index?

A

If you need to track a relationship between values that have a lot of different values.

37
Q

True or False: Global Secondary Index keys must be unique.

A

False

38
Q

What is the consistency model for a Global Secondary Index?

A

Eventual consistency

39
Q

True or False: A Global Secondary Index must be provisioned for its own read and write capacity.

A

True

40
Q

Can a Local Secondary Index be deleted?

A

No

41
Q

True or False: A Local Secondary Index must be provisioned for its own read and write capacity.

A

False

42
Q

What data types can be indexed?

A

All scalar types. Number, String, Binary

43
Q

What are item collections?

A

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
Q

True or False: Item Collections must be created manually

A

False.

45
Q

Is there a limit size for an Item Collection?

A

Yes. 10GB

46
Q

What is Reserved Capacity?

A

A billing feature that allows you to obtain discounts on provisioned throughput.

47
Q

What is the smallest amount of reserved capacity that can be purchased?

A

100 capacity units