‫So now let's talk
‫about DynamoDB Accelerator or DAX.
‫DAX is a fully-managed, highly available
‫and seamless in-memory cache for DynamoDB.
‫The idea is that you're going to cache
‫the most popular data,
‫and therefore you're going to get microsecond latency
‫for cached reads and queries.
‫It doesn't require you to change any
‫of your application logic,
‫it's compatible with the existing DynamoDB APIs.
‫And you just create a DAX cluster and you're good to go.
‫Now, DAX, what does it solve?
‫It solves the hot key problems.
‫So if you're reading a very specific key
‫or a very specific item,
‫too many times then you may get throttling on your RCU's.
‫But if it's cached by DAX,
‫then you've just solved that problem.
‫So let's have an example, we DynamoDB it's made of tables
‫and our application is trying to access these tables.
‫Now in between, we're going to create a DAX cluster,
‫which is made of cache nodes,
‫and we have to provision them in advance.
‫Now the application will directly interact
‫with the DAX cluster,
‫and the DAX cluster will fetch the data
‫from the DynamoDB tables.
‫So by default, that means that some data
‫is going to be cached,
‫and if you think cached, you need to think TTL.
‫So the TTL is going to be five minutes.
‫So by default, every cache data will live
‫for five minutes in your DAX cluster.
‫Now the DAX cluster is made of nodes,
‫and so therefore you need to provision them
‫and you can have up to 10 nodes in the cluster.
‫And it's a good idea to be in a Multi-AZ kind of setup
‫to have at least three nodes recommended in production.
‫So one in each AZ.
‫And DAX is fully secure,
‫so you have encrypted at rest.
‫You have IAM application, VPC security,
‫CloudTrail integration, and so on.
‫So remember DAX is here to help you cache
‫the most popular items or queries from DynamoDB.
‫Now, the question we have,
‫is what's the difference between DynamoDB Accelerator,
‫so DAX and ElastiCache?
‫Well, they can be used as a combination
‫and the exam may test you on figuring out
‫if it's best to use DynamoDB DAX,
‫or if you wanna use ElastiCache.
‫So with DAX, what you're going to do
‫is that you're going to have a cache
‫for individual objects or for your queries,
‫or your scans.
‫This is very, very handy,
‫and this is what I call simple types of queries.
‫So your objects, your queries and your scans.
‫But if you're doing some kind of logic application wise,
‫you know you're like doing a scan
‫and then you're doing the sum,
‫and then you're filtering out some data, and so on.
‫And you don't want to do this every single time,
‫because this is computationally expensive.
‫What you can do, is you can store the results
‫of whatever your application just did
‫in Amazon ElastiCache.
‫And retrieve the data from ElastiCache directly,
‫instead of re-querying DAX and re-performing
‫the aggregation client side.
‫So this could be a good way
‫to actually use them both together in the architecture.
‫Okay.
‫So now let's go ahead
‫and see how we can create a DAX cluster.