DynamoDB Flashcards
DynamoDB
Write Capacity Unit
- one write per second for an item up to 1 KB in size
- (ITEM SIZE (rounded up to the next 1KB)/1KB) * # of items
Example: we write 10 objects per second of 2KB each.
- we need 2 * 10 = 20 WCU
DynamoDB
Read Capacity Unit
- 4 KB units
- 1 strongly consistent read request
- 2 eventually consistent read request
- (ITEM SIZE (rounded up to the next 4KB)/4KB) * # of items.
DynamoDB Streams
- ordered flow of information about changes to the items in the table
- all data in the stream is subject to a 24 hour life time.
DynamoDB Stream View Types
KEYS_ONLY
NEW_IMAGE
OLD_IMAGE
NEW_AND_OLD_IMAGE
DynamoDB
Global Secondary Index
- speed up queries on non-key attributes
- contains selection of attributes from the base table but are organized by a primary key
- queries support eventual consistency attributes
- basically creates a new table based of a base table with new primary keys and sort keys
DynamoDB
Local Secondary Index
- this is used for queries which use the same partition key value
- maintains an alternate sort key for a given partition
- can only be added when a table is created
- local to the partition
DynamoDB
Scan Operations
- less efficient than other operations
- always scan the entire or secondary index
- returns all the data attributes for the table
- supports filters
DynamoDB
ProvisionedThroughputExceededExceptions
◦ Reasons: ‣ Hot Keys: one partition key is being read too much ‣ Hot Partitions: ‣ Large Items: ◦ Solutions ‣ Exponential back-off ‣ Distribute the partitions keys are much as possible ‣ If RCU issue using DAX caching
DynamoDB Stream Type: KEYS_ONLY
only the key attribute of the modified item are written
DynamoDB Stream Type: NEW_IMAGE
the entire item after it was modified is written
DynamoDB Stream Type: OLD_IMAGE
the entire item before it was modified is written to the stream
DynamoDB Stream Type: NEW_AND_OLD_IMAGE
both new and old image are written to the stream