DynamoDB Accelerator (DAX)

DynamoDB Accelerator (DAX)

DynamoDB Accelerator (DAX)

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog posts, we have discussed Global Tables in DynamoDB.

https://cloudaffaire.com/global-table-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.

DAX Components:

Nodes:

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.

Clusters:

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:

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.

Security Groups:

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.

Cluster ARN:

Every DAX cluster is assigned an Amazon Resource Identifier (ARN). The ARN format is: arn:aws:dax:region:accountID:cache/clusterName

Cluster Endpoint:

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.

Node Endpoints:

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

Subnet Groups:

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.

Events:

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 the AWS console.

Step 1: Login to AWS console and navigate to DynamoDB.

DynamoDB Accelerator (DAX)

Note: DAX is not supported in all regions. For this demo, we are using EU-Ireland (eu-west-1) as a 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’.

DynamoDB Accelerator (DAX)

Step 3: Provide your DAX Cluster details and click ‘Launch Cluster’.

DAX cluster name, node type, and encryption:

DynamoDB Accelerator (DAX)

IAM role:

DynamoDB Accelerator (DAX)

Subnet Groups and Security Groups:

DynamoDB Accelerator (DAX)

Warning: Additional charges apply for DAX cluster.

Our DAX cluster successfully created

DynamoDB Accelerator (DAX)

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.

DynamoDB Accelerator (DAX)

Cleanup: Select the DAX cluster and from ‘Actions’ click ‘Delete’.

DynamoDB Accelerator (DAX)

Hope you have enjoyed this article. DAX has tons of advanced 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

https://docs.aws.amazon.com/dynamodb/index.html

 

Leave a Reply

Close Menu