DynamoDB Flashcards
What is DynamoDB?
is a key-value and document database (NoSQL) that delivers single-digit millisecond performance at any scale. It’s a fully managed, multiregion, multimaster, durable database with built-in security, backup and restore, and in-memory caching for internet-scale applications
What uses DynamoDB for security administration and auth?
IAM
Is DynamoDB replicated?
across 3 AZs
What are DynamoDB features?
- Scales to massive workloads, distributed database
- Millions of requests per seconds, trillions of row, 100s of TB of storage
- Fast and consistent in performance (low latency on retrieval)
- Enables event driven programming with DynamoDB Streams
- Low cost and auto scaling capabilities
What is made off DynamoDB?
tables
What is better to use DynamoDB? read or write?
to write: RCU cost = 5 x WCU cost
What must have DynamoDB provisioned mode tables defined for throughput?
Read Capacity Units (RCU) and Write Capacity Units (WCU)
What is a DynamoDB Read Capacity Unit?
- 1 RCU = 1 strongly consistent read of 4 KB per second
* 1 RCU = 2 eventually consistent read of 4 KB per second
What is a DynamoDB Write Capacity Unit?
• 1 WCU = 1 write of 1 KB per second
What you need to have if DynamoDB throughput must be temporarily exceeded?
burst credit
What happens If your DynamoDB burst credit is empty
you’ll get a “ProvisionedThroughputException”
Can you set auto scaling DynamoDB RCU and WCU
yes
What are the read/write capacity modes of DynamoDB?
Provisioned (Free tier)
On demand
What is DynamoDB Streams?
To capture and process changes to DynamoDB items on a table (Create, Update, Delete) on Streams
What can read DynamoDB Streams?
Lambda
What are good scenarios for using DynamoDB Streams?
• React to changes in real time (welcome email to new users) • Analytics • Create derivative tables / views • Insert into ElasticSearch
What can you use to implement CRR on DynamoDB?
DynamoDB Streams
What is the retention time for data on DynamoDB Streams?
1 day
Does DynamoDB accept Transactions?
Yes
Can you access DynamoDB without internet?
Yes, through VPC endpoints
Can you encrypt data in DynamoDB?
yes, at rest (KMS) and in transit (SSL / TLS)
Can you restore tables using DynamoDB?
yes, it has Point In Time Restore and it does not affect performance
What is Amazon DMS?
AWS Database Migration Service (AWS DMS) is a cloud service that makes it easy to migrate relational databases, data warehouses, NoSQL databases, and other types of data stores
What is DynamoDB Global Tables?
provide a fully managed solution for deploying a multiregion (CRR), multi-master database, without having to build and maintain your own replication solution
What you must enable to DynamoDB Global Tables to work?
DynamoDB Streams
How can you build applications that react to data modifications in DynamoDB tables?
Amazon DynamoDB is integrated with AWS Lambda so that you can create triggers—pieces of code that automatically respond to events in DynamoDB Streams.
What is a NoSQL database?
NoSQL databases are non-relational, distributed databases that scale horizontally
What is composed of DynamoDB tables?
- Each table has a primary key (must be decided at creation time)
- Each table can have an infinite number of rows
- Each row has attributes (can be added over time – can be null)
What is DynamoDB item max size?
The maximum size of an item is 400KB
What are two options to define a DynamoDB primary key?
- Option 1: Partition key only (HASH)
* Option 2: Partition key + Sort Key (optional)
What conditions must be accomplished by a DynamoDB Partition Key only primary key?
o Partition key must be unique for each item
o Partition key must be “diverse” so that the data is distributed
o Example: user_id for a users table
What conditions must be accomplished by a DynamoDB Partition Key + Sort Key primary key?
o The combination must be unique o Data is grouped by partition key o Sort key is also known as range key o Example: users-games table user_id for the partition key game_id for the sort key
What is advised to do if you get a DynamoDB ProvisionedThroughputExceptions?
o Exponential back-off when exception is encountered (already in SDK)
o Distribute partition keys as much as possible
o If RCU issue, we can use DynamoDB Accelerator (DAX)
Solve these DynamoDB WCU examples:
• Example 1: we write 10 objects per seconds of 2 KB each.
• Example 2: we write 6 objects per second of 4.5 KB each
• Example 3: we write 120 objects per minute of 2 KB each
o We need 2 * 10 = 20 WCU
o We need 6 * 5 = 30 WCU (4.5 gets rounded to the upper KB)
o We need 120 / 60 * 2 = 4 WCU
What is DynamoDB Eventually Consistent Reads?
If we read just after a write, it’s possible we’ll get unexpected response because of replication
What is DynamoDB Strongly Consistent Reads?
If we read just after a write, we will get the correct data
What Consistent Read option is used by default on DynamoDB?
By default DynamoDB uses Eventually Consistent Reads, but GetItem, Query & Scan provide a “ConsistentRead” parameter you can set to True