DynamoDB Flashcards
DynamoDB Max size of an item is…
400KB
Mode that needs to have capacity planned beforehand
Provisioned
Mode that has read/writes auto scale up/down with workloads
On-Demand
Write Capacity Units equation
Items per second * (item size/1KB) = WCUs
Write 6 items per second with item size 4.5KB equals how many WCUs
30 WCUs
Write 120 items per minute with item size 2 KB equals how many WCUs
4 WCUs
If you read just after a write, it’s possible to get some stale data because of
Eventually Consistent Read
If you read just after a write, you get the correct data
Strongly Consistent Read
Default Consistent Read mode
Eventually
Read Capacity Units equation - SCR
Reads per second * (item size/4KB)
SCR 10 per second with item size of 6KB equals how many RCUs?
20 RCUs
ECR 16 per second with item size of 12KB equals how many RCUs
24 RCUs
Error “ProvisionedThroughputExceededException” happens because of
Throttling
Hot Keys can cause
Throttling
Hot Partitions can cause
Throttling
Very large items can cause
Throttling
Use cases of unknown workloads and unpredictable app traffic are good for which capacity mode
On-Demand
Creates new item or fully replace an old item
PutItem
Edits an existing item’s attributes or adds a new item if it doesn’t exist
UpdateItem
Accept a write/update/delete only if conditions are met, otherwise return error
Conditional Writes
Read based on primary key
GetItem
Read entire table and then filter out data
Scan
Use __ Scan for faster performance
Parallel
Delete data
DeleteItem
Quicker deletion than DeleteItem
DeleteTable
Alternative Sort key that must be defined at table creation time
Local Secondary Index
Up to _ LSI per table
5
Alternative primary key from the base table that can be added/modified after table creation
Global Secondary Index
If writes are throttled on the Global Secondary Index, then the main table will…
be throttled
Must provision RCUs & WCUs for this type of index
GSI
Can solve “Hot Key” problem in DynamoDB
DynamoDB Accelerator (DAX)
T/F: DAX is Multi-AZ
True
CLI command used to retrieve one or more attributes
–projection-expression
CLI command to filter items before return to you
–filter-expression
CLI command that specify that AWS retrieves the full list of items but with a larger # of API calls
–page-size
CLI command to specify the max # of items to show in the CLI (returns NextToken)
–max-items
CLI command to specify the last NextToken to retrieve the next set of items
–starting-token
Transactions consume _x WCUs & RCUs
2
One or more GetItem operations
TransactGetItems
One or more PutItem, UpdateItem, and DeleteItem operations
TransactWriteItems
Read Capacity Units equation - ECR
(Reads per second / 2) * (item size / 4KB) = RCUS