Dynamo DB Flashcards
What are NoSQL databases?
NoSQL database are non-relational databases and are distributed.
What is DynamoDB?
A fully-managed, highly available, NoSQL database that scales to massive workloads.
What are the data types supported by DynamoDB?
- Scalar Types: String, Number, Binary, Boolean, Null
- Document Types: List, Map
- Set Types: String Set, Number Set, Binary Set
How many items (rows) can a DynamoDB table have?
An infinite number of rows.
What is the maximum size of a item (row) in DynamoDB?
400KB
What are the options for DynamoDB Primary Keys?
- Partition Key (HASH)
- Partition Key + Sort Key (HASH + RANGE)
What are the read/write capacity modes for DynamoDB? How often can you switch between these modes?
- Provisioned Mode (default): Plan for capacity beforehand
- On-Demand Mode: Read/writes scale with the workload
You can switch between these modes every 24 hours.
If the Burst Capacity throughput is exceeded what exception will you get? How should you retry on this exception?
You’ll get a ProvisionedThroughputExceededException. You should you use an exponential backoff when retrying.
What is a WCU?
A Write Capacity Unit (WCU) represents one write per second for an item up to 1KB in size.
How many WCUs are used when we write 10 items per second with an item size of 2KB?
We need 10*(2KB/1KB) = 20 WCUs
How many WCUs are used when we write 6 items per second with an item size of 4.5KB?
6*(5KB/1KB) = 30 WCUs (4.5 gets rounded to the upper KB)
What are the two read modes for DynamoDB?
- Strongly Consistent Read: If we read just after a write we will get the correct data. Consumes twice the RCU.
- Eventually Consistent Read (default): Possible to get stale data before replication
What is an RCU?
A Read Capacity Unit (RCU) represents one Strongly Consistent Read per second or two Eventually Consistent Reads per second for an item up to 4KB.
How many RCUs are used when we have 10 Strongly Consistent Reads per second with an item size 4KB.
10*(4KB/4KB) = 10 RCUs
How many RCUs are used when we have 16 Eventually Consistent Reads per second with an item size of 12KB?
(16/2)*(12KB/4KB) = 24 RCUs