DynamoDB Flashcards
This deck aims to help retain concepts related to the DynamoDB service.
What AWS service provides a serverless, NoSQL database ideal for modern application development, with no cold starts, version upgrades, maintenance windows, patching, or downtime?
DynamoDB
What is the value of a Write Capacity Unit (WCU) in AWS DynamoDB?
One WCU allows for one write per second for an item up to 1KB (rounds to nearest whole)
What is the value of a Read Capacity Unit (RCU) in AWS DynamoDB?
One RCU allows for one strongly consistent read operation per second, or two eventually consistent read operations per second for an item up to 4KB (rounds to nearest whole)
Which DynamoDB feature allows multiple application workers to scan segments of a table or secondary index in parallel?
Parallel Scan
What actions can be taken to improve application performance when interacting with a DynamoDB table?
- Use queries instead of scans
- Use parallel scans (if have to)
What does the following AWS CLI command do for DynamoDB?
aws dynamodb create-table \
--table-name Customers \
--attribute-definitions \
AttributeName=ID,AttributeType=N \
AttributeName=Name,AttributeType=S \
--key-schema \
AttributeName=ID,KeyType=HASH \
AttributeName=Name,KeyType=RANGE \
--provisioned-throughput \
ReadCapacityUnits=10,WriteCapacityUnits=5
Creates a Customers
table with ID (number) as the partition key and Name (string) as the sort key, along with provisioned throughput of 10 RCUs and 5 WCUs
What DynamoDB feature allows you to retrieve only specific attributes of an item?
Projection Expression
Which DynamoDB feature can prevent the creation of an item if it already exists or inhibit updates based on a specific condition?
Conditional Expressions
What parameter should be included in an AWS DynamoDB query to indicate the total read capacity consumed?
ReturnConsumedCapacity: TOTAL
What property ensures that the most up-to-date data is returned when retrieving an item from AWS DynamoDB?
ConsistentRead = true
during the GetItem
operation
What AWS DynamoDB operation retrieves attributes of one or more items from one or more tables and allows multiple Partition Key values in a single request?
BatchGetItem
When querying AWS DynamoDB with Conditional Expressions, what parameters are required?”
- key condition expression (a string determining items to read)
- partition key name and value
What AWS DynamoDB feature can be used to create backups of your tables?
On-demand Backup
Which AWS DynamoDB operation allows grouping multiple actions into a single all-or-nothing transaction?
TransactWriteItems
Given the requirements of reading 60 items per second (6KB each) and writing 80 items per second (1.5KB each), how do you calculate the required RCUs and WCUs for AWS DynamoDB table?
To calculate RCU:
1. Item size / RCU value = 6 KB / 4 KB = 1.5 round to nearest whole = 2 RCU per item
2. Reads per second * RCU per item = 60*2 = 120 RCU
To calculate WCU:
1. Item size / WCU value = 1.5 KB / 1 KB = 1.5 round to nearest whole = 2 WCU per item
2. Writes per second * WCU per item = 80 * 2 = 160 WCU
How does DynamoDB Accelerator (DAX) handle strongly consistent reads with AWS DynamoDB?
For strongly consistent read requests, the DAX cluster passes all requests to DynamoDB without caching
What is an efficient way to delete all data from DynamoDB table with minimal costs?
Delete the table and then re-create it using the DeleteTable
operation
How can you prevent write throttling when using a Global Secondary Index (GSI) in Amazon DynamoDB?
Ensure the provisioned write capacity of the GSI is equal to or greater than that of the base table, as updates write to both the table and the GSI