DynamoDB Accelerator (DAX)
Welcome to CloudAffaire and this is Debjeet
In the last blog posts, we have discussed Global Tables in DynamoDB.
In this blog post we are going to discuss DynamoDB Accelerator (DAX). We will also create a single node DAX cluster using AWS console.
DynamoDB Accelerator (DAX)
Amazon DynamoDB is designed for scale and performance. In most cases, the DynamoDB response times can be measured in single-digit milliseconds. however, there are certain use cases that require response times in microseconds. For these use cases, DynamoDB Accelerator (DAX) delivers fast response times for accessing eventually consistent data. DAX is a DynamoDB-compatible caching service that enables you to benefit from fast in-memory performance for demanding applications.
A node is the smallest building block of a DAX cluster. Each node runs an instance of the DAX software, and maintains a single replica of the cached data.
A cluster is a logical grouping of one or more nodes that DAX manages as a unit. One of the nodes in the cluster is designated as the primary node, and the other nodes (if any) are read replicas.
Regions and Availability Zones:
A DAX cluster in an AWS region can only interact with DynamoDB tables that are in the same region. For this reason, you need to ensure that you launch your DAX cluster in the correct region. If you have DynamoDB tables in other regions, you will need to launch DAX clusters in those regions too.
Parameter groups are used to manage runtime settings for DAX clusters. DAX has several parameters that you can use to optimize performance (such as defining a TTL policy for cached data). A parameter group is a named set of parameters that you can apply to a cluster, thereby guaranteeing that all of the nodes in that cluster are configured in exactly the same way.
A DAX cluster runs in an Amazon VPC environment—a virtual network that is dedicated to your AWS account, and is isolated from other Amazon VPCs. A security group acts as a virtual firewall for your VPC, allowing you to control inbound and outbound network traffic.
Every DAX cluster is assigned an Amazon Resource Identifier (ARN). The ARN format is: arn:aws:dax:region:accountID:cache/clusterName
Every DAX cluster provides a cluster endpoint for use by your application. By accessing the cluster using its endpoint, your application does not need to know the host names and port numbers of individual nodes in the cluster. Your application automatically “knows” all of the nodes in the cluster, even if you add or remove read replicas.
Each of the individual nodes in a DAX cluster has its own host name and point number. Here is an example of a node endpoint: myDAXcluster-a.2cmrwl.clustercfg.dax.use1.cache.amazonaws.com:8111
Access to DAX cluster nodes is restricted to applications running on Amazon EC2 instances within an Amazon Virtual Private Cloud (Amazon VPC) environment. You can use subnet groups to grant cluster access from Amazon EC2 instances running on specific subnets. A subnet group is a collection of subnets (typically private) that you can designate for your clusters running in an Amazon Virtual Private Cloud (VPC) environment.
DAX records significant events within your clusters, such as a failure to add a node, success in adding a node, or changes to security groups. By monitoring key events, you can know the current state of your clusters and, depending upon the event, be able to take corrective action. You can access these events using the AWS Management Console, or the DescribeEvents action in the DAX management API.
Next, we are going to create a single node DAX cluster using AWS console.
Step 1: Login to AWS console and navigate to DynamoDB.
Note: DAX is not supported in all regions. For this demo we are using EU-Ireland (eu-west-1) as region. If you are currently in a non-supported region, then change it to a supported one.
Step 2: Click ‘Create cluster’ located under ‘Dashboard’.
Step 3: Provide your DAX Cluster details and click ‘Launch Cluster’.
DAX cluster name, node type, and encryption:
Subnet Groups and Security Groups:
Warning: Additional charges apply for DAX cluster.
Our DAX cluster successfully created
Note: In order to use DAX, you need to provide the DAX cluster endpoint to application connection
Cluster endpoint: cloudaffaire-dax-clu.b4hqhw.clustercfg.dax.euw1.cache.amazonaws.com:8111
In order to access the DAX cluster, we need to open TCP port 8111 in our default security group inbound rule.
Cleanup: Select the DAX cluster and from ‘Actions’ click ‘Delete’.
Hope you have enjoyed this article. DAX has tons of advance features and use cases which will be covered in future blogs. With this we are ending our introductory series on DynamoDB. In the next blog post we will start with a new AWS service.
To get more details on DynamoDB, please refer below AWS documentation