DynamoDB Flashcards

1
Q

What type of database is DynamoDB?

A

NoSQL, non-relational, fully managed, highly available, horizontally scalable

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

What is the maximum item size in DynamoDB?

A

400KB including all attribute names and values

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

What are the data types supported by DynamoDB?

A

Scalar (String, Number, Binary), Document (List, Map), Set (String Set, Number Set, Binary Set)

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

What is a Partition Key?

A

Primary key that must be unique for each item and ensures data distribution

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

What is a Sort Key?

A

Used with Partition Key for composite primary keys, allows grouping and sorting

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

What are RCU and WCU in DynamoDB?

A

RCU = 1 strong read/sec for 4KB or 2 eventual, WCU = 1 write/sec for 1KB

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

What are the two read/write capacity modes in DynamoDB?

A

Provisioned and On-Demand

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

What causes ‘ProvisionedThroughputExceededException’?

A

Exceeding provisioned RCUs/WCUs or hot partition keys

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

What DynamoDB feature can reduce hot key issues?

A

DAX (DynamoDB Accelerator)

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

What operation reads items by Primary Key?

A

GetItem

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

What operation is used to retrieve multiple items with the same partition key?

A

Query

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

What operation scans the whole table?

A

Scan

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

What is the difference between Query and Scan?

A

Query is efficient and uses keys, Scan reads the entire table

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

What are DynamoDB Streams?

A

Ordered stream of item-level changes in a table

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

What can consume DynamoDB Streams?

A

Lambda, Kinesis, KCL Apps

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

What is TTL in DynamoDB and what happens when items expire?

A

Auto-deletes items after Unix timestamp. Items may briefly appear in reads before deletion.

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

What is a Local Secondary Index (LSI)?

A

Alternate sort key, same partition key, up to 5 per table, defined at table creation

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

What is a Global Secondary Index (GSI)?

A

Alternate primary key, can be added anytime, requires separate RCUs/WCUs

19
Q

What happens if a GSI is throttled?

A

Writes to the base table may also be throttled

20
Q

What is the SQL-compatible query language for DynamoDB?

21
Q

What are Conditional Writes in DynamoDB?

A

Write operations that only succeed if conditions are met (e.g. attribute_not_exists)

22
Q

What does ‘attribute_not_exists’ help with?

A

Prevents overwriting existing items

23
Q

What are DynamoDB Transactions?

A

ACID complaint Atomicity, Consistency, Isolation, Durability. Enable coordinated, all or nothing operations on one or more items across one or more tables in DynamoDb.

24
Q

What is the DynamoDB CLI option to retrieve specific attributes?

A

–projection-expression

25
What is DAX?
In-memory caching for DynamoDB with microsecond latency
26
What is the default cache TTL for DAX?
5 minutes
27
What security features does DynamoDB support?
IAM, KMS encryption, VPC endpoints, SSL/TLS
28
What is the use of DynamoDB Streams in cross-region replication?
Provides real-time change data for replication
29
What is the maximum retention of DynamoDB Streams?
24 hours
30
What is Optimistic Locking in DynamoDB?
Uses version number to avoid conflicts during concurrent writes
31
How do you manage fine-grained access control in DynamoDB?
IAM with conditions on LeadingKeys and attributes
32
What are the TTL stream options?
KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES
33
Can you use DynamoDB without internet access?
Yes, using DynamoDB Local
34
When should you use On-Demand mode in DynamoDB?
Unpredictable or spiky workloads
35
What AWS service helps migrate data to DynamoDB?
AWS Database Migration Service (DMS)
36
What is Write Sharding in DynamoDB?
Technique to distribute writes across partitions by adding suffixes to avoid hot partitions and throttling
37
What is the Partition Key Hashing used for?
Determines which partition the item goes to
38
How are Scan and Parallel Scan different?
Parallel Scan uses multiple workers to scan data segments
39
What does --filter-expression do in CLI?
Filters items before they are returned
40
What does --max-items do in CLI?
Limits number of items shown and returns a NextToken
41
Can conditional writes be used in BatchWriteItem?
No, BatchWriteItem does not support condition expressions
42
How does DynamoDB ensure consistency?
Offers Strongly Consistent Reads as an option
43
What does 'Begins_with' condition do?
Checks if an attribute starts with a given substring
44
Can you use IAM to limit attribute-level access?
Yes, via fine-grained access policies