DynamoDB COPY Flashcards
How is DynamoDB replicated?
By default, DynamoDB is fully managed and replicated across 3 Availability Zones.
How do you enable Event Driven programming in DynamoDB?
Use DynamoDB Streams
What is the max size of an item/row in DynamoDB?
400KB
What data types are supported in DynamoDB?
- Scalar Types: String, Number, Binary, Boolean, Null
- Document Types: Map, List
- Set Types: String Set, Binary Set, Number Set
What is your first option for a primary key?
A Unique Hash Key / Partition Key
What is your second option for a primary key?
A combination of partition key and a sort key
What is the sort key also known as?
Range key
What is RCU?
Read Capacity Units: throughput for reads
What is WCU?
Write Capacity Units: throughput for writes
Why would you get a “ProvisionedThroughputException”?
If you have temporarily exceeded your throughput limit and used all of the available burst credits.
What should you do if you get a “ ProvisionedThroughputException”?
Use an exponential backoff
Why would you get a “ProvisionedThroughputExceeded Exception”?
Hot keys, too many requests to the same partition or very large items exceeding the WCU/RCU.
What can be done to resolve a “ProvisionedThroughputExceeded Exception”?
- Exponential backoff
- Distributed partition keys
- Dynamo Accelerator (DAX)
What can you do to prevent ProvisionedThroughputExceeded Exceptions
Use Auto Scaling to increase WCU/RCU depending on activity
What command will write to Dynamo
PutItem
What command will update an item
UpdateItem
How do you deal with concurrency with regards to writes?
Use Conditional Writes
How do you remove from Dynamo
DeleteItem
How do you do batch writes in Dynamo?
BatchWriteItem
How many items can you write/delete in one PutItem/DeleteItem call for batches?
25
What is the item size limit in a batch?
400KB
What is the data limit that can be written in one Batch call?
16MB
What happens when a batch items fails?
It is up to me to retry
How can you query in Dynamo?
- Query on exact partitionKey
- Optional Sort Key (=, , >=, BETWEEN, BEGIN)