DynamoDB Flashcards
What type of database is DynamoDB?
NoSQL, non-relational, fully managed, highly available, horizontally scalable
What is the maximum item size in DynamoDB?
400KB including all attribute names and values
What are the data types supported by DynamoDB?
Scalar (String, Number, Binary), Document (List, Map), Set (String Set, Number Set, Binary Set)
What is a Partition Key?
Primary key that must be unique for each item and ensures data distribution
What is a Sort Key?
Used with Partition Key for composite primary keys, allows grouping and sorting
What are RCU and WCU in DynamoDB?
RCU = 1 strong read/sec for 4KB or 2 eventual, WCU = 1 write/sec for 1KB
What are the two read/write capacity modes in DynamoDB?
Provisioned and On-Demand
What causes ‘ProvisionedThroughputExceededException’?
Exceeding provisioned RCUs/WCUs or hot partition keys
What DynamoDB feature can reduce hot key issues?
DAX (DynamoDB Accelerator)
What operation reads items by Primary Key?
GetItem
What operation is used to retrieve multiple items with the same partition key?
Query
What operation scans the whole table?
Scan
What is the difference between Query and Scan?
Query is efficient and uses keys, Scan reads the entire table
What are DynamoDB Streams?
Ordered stream of item-level changes in a table
What can consume DynamoDB Streams?
Lambda, Kinesis, KCL Apps
What is TTL in DynamoDB and what happens when items expire?
Auto-deletes items after Unix timestamp. Items may briefly appear in reads before deletion.
What is a Local Secondary Index (LSI)?
Alternate sort key, same partition key, up to 5 per table, defined at table creation
What is a Global Secondary Index (GSI)?
Alternate primary key, can be added anytime, requires separate RCUs/WCUs
What happens if a GSI is throttled?
Writes to the base table may also be throttled
What is the SQL-compatible query language for DynamoDB?
PartiQL
What are Conditional Writes in DynamoDB?
Write operations that only succeed if conditions are met (e.g. attribute_not_exists)
What does ‘attribute_not_exists’ help with?
Prevents overwriting existing items
What are DynamoDB Transactions?
ACID complaint Atomicity, Consistency, Isolation, Durability. Enable coordinated, all or nothing operations on one or more items across one or more tables in DynamoDb.
What is the DynamoDB CLI option to retrieve specific attributes?
–projection-expression