Instructor: So, let's talk about DynamoDB-DAX
and DAX stands for accelerator.
And so, accelerator means that it's a seamless cache
for DynamoDB and you can enable it
and you don't need to re-write any of your applications.
They work just the same.
But now, all the writes you do to DynamoDB,
they go through DAX.
And DAX basically provides you micro-second latency,
so very low latency in case you have
a cache read or cache query.
So, this is a cache for your reads,
and it solves the Hot Key problems.
So, for example, you have a popular ad
entering a big sale during the year,
and that item is being queried a lot,
so you get too many reads on that item
and you get a Hot Key problem because
you exceed your throughput,
then you put DAX in front of your,
DynamoDB cluster, and all of a sudden
the reads are done from the cache,
and so the problem of the Hot Key is solved.
By default, your items live for
five minutes in your cache.
And you can have up to 10 nodes
in your cache cluster, so you can scale a lot.
It is multi AZ, so you can enable
multiple nodes in multiple availability zones,
and in production it's recommended you have
a minimum of three nodes to enhance that availability.
Finally, just like everything we've seen
DAX is secure, you get encryption at rest
using KMS, you have VPC end points,
you have IAM permissions, and you can use CloudTrail.
So here is your DynamoDB, and you have say,
three tables in your DynamoDB,
and so our applications basically,
instead of talking straight to DynamoDB
they are going to interact with the
Amazon DynamoDB accelerator,
so no code change, just straight interaction
with the DynamoDB accelerator.
The accelerator itself will interact
with your DynamoDB databases,
and it will be smart enough to cache whatever is needed,
whenever it is needed.
So it's a very simple concept,
it's a very easy way to cache some reads,
and improve your application performance at minimal costs.
To enable DAX, nothing easier.
We just go to DAX on the left hand side,
and you have a DAX enabled region for it,
you see this left hand side?
We go to dashboard, and we see we have
no clusters running, but we could create a cluster,
we could name it you say, "mychache,"
and then you specify the type of nodes you want.
So obviously, you can have some very small instances
like t2.small, t2.medium, but you can go
all the way to r4.16xlarge if you have
a very, very heavy application for reads.
You select the cluster size,
so you can go from one to 10 nodes,
and greater nodes gives you better availability,
and better performance for read scale.
You can enable encryption for you data
to be protected at rest.
You need to give an IAM role to DAX,
and this IAM role must be granted the access
to your DynamoDB tables.
Then you need to select a subnet group,
which is where your DAX cluster will be
created in your VPC.
And you can assign some security groups, as well.
Finally for the cluster setting,
you can use a default setting which
gives you a TTL of five minutes,
no preference for availability zones,
no preference for maintenance windows,
so your cluster will be taken down
from time to time, but one node at a time,
and no notification.
But you can change all these things.
I'm not going to go ahead and create this,
because this will cost money
even if you use a t2.small,
DAX is not in the free tier.
But I just wanted to show you how easy
it was to just create a DAX cluster.
So that's it for this lecture,
I hope you liked it, and I will see you in the next lecture.