DynamoDB Flashcards
DynamoDB
fully managed, highly available database.
And it has replication across 3 AZ by default.
It’s a NoSQL database.
it scales to massive workload and it’s a distributed database
low cost
DynamoDB scale and performance
there’s millions of requests per second
that can be done through DynamoDB.
It can scale to trillions of row
and hundreds of terabytes of storage.
ven if you have a lot of data, you can still get low latency on data retrieval.
has auto scaling capabilities.
DynamoDB IAM
integrated with IAM for security,
authorization, and administration.
So this is one of these cloud-native thing on AWS side.
DynamoDB enables
event driven programming with DynamoDB Streams.
DynamoDB is made of
tables.
And each table has a primary key.
And you decide of that primary key at creation time.
And so you note there’s no creating of database.
The database is already available.
You just start directly by creating tables.
Now each table can have an infinite number of items,
each row, or each item,
will have attributes.
And they can be added over time.
And these attributes can be null.
So an attribute is like a column in a RDS database.
Now the maximum size of an item is 400 kilobytes.
data types supported
scalar types.
So string, number, binary, Boolean, and null.
And document types such as list and map.
Set types, such as string set, number set, and binary set.
provision throughputs (exam)
doing DynamoDB, (not on-demand DynamoDB)
and we must provision read and write capacity units.
Read Capacity Unit
an RCU defines a throughput for a read.
one RCU means that you have
- one strongly consistent read of four kilobyte per second,
or
- two eventually consistent read of four kilobyte per second.
WCU
throughput for writes
It’s about five times as expensive than RCU.
So DynamoDB is better when you read more than when you write more.
one WCU is one write of one kilobyte per second.
auto scaling option
there’s an option to set up auto scaling of throughputs to meet the demand over time.
burst credits
And the throughput can be exceeded temporarily using something called burst credits.
And if the burst credit are empty, then you’re going to get a ProvisionedThroughputException.
in this case, you can do an exponential back-off retry to, hopefully, get the read or the write working eventually.
DAX
DynamoDB Accelerator
a seamless cache
You don’t need to rewrite your application, the cache writes will go, the writes to DB will go through DAX,
and then the reads will be cached,
and you have micro seconds latency.
Hot Key problem
when you get too many reads on one value in DynamoDB.
Each cache entry has a TTL
has a five minutes TTL by default. So that means that anytime you read something from DynamoBD, it’s gonna be cached for five minutes in DAX
and that really allows you to relieve pressure off of DynamoDB if you need to.