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 addresses three core scenarios:
As an in-memory cache, DAX reduces the response times of eventually consistent read workloads by an order of magnitude from single-digit milliseconds to microseconds.
DAX reduces operational and application complexity by providing a managed service that is API-compatible with DynamoDB. Therefore, it requires only minimal functional changes to use with an existing application.
For read-heavy or bursty workloads, DAX provides increased throughput and potential operational cost savings by reducing the need to overprovision read capacity units. This is especially beneficial for applications that require repeated reads for individual keys.
DAX supports server-side encryption. With encryption at rest, the data persisted by DAX on disk will be encrypted. DAX writes data to disk as part of propagating changes from the primary node to read replicas. For more information, see
DAX also supports encryption in transit, ensuring that all requests and responses between your application and the cluster are encrypted by transport level security (TLS), and connections to the cluster can be authenticated by verification of a cluster x509 certificate.
Key Features
Performance Improvement:
DAX improves read performance from milliseconds to microseconds.
It is especially beneficial for read-heavy and bursty workloads such as auction applications, gaming, and retail sites during special sales or promotions.
Managed Service:
DAX is a managed service, meaning AWS handles cache invalidation, data population, and cluster management.
It provides a fully managed, highly available cache without the operational overhead of managing cache infrastructure.
In-Memory Caching:
DAX stores frequently accessed items in memory, significantly speeding up read times.
It is an in-memory cache, meaning data is stored in RAM for faster retrieval compared to disk-based storage.
Write-Through Caching:
DAX operates as a write-through cache, meaning writes to DynamoDB are simultaneously written to the DAX cache.
This ensures that data in the cache is always up-to-date with the data in DynamoDB.
Seamless Integration:
DAX is compatible with existing DynamoDB API calls, making it easy to integrate without modifying your application logic.
You can enable DAX via the AWS Management Console or AWS SDK.
Cluster Management:
DAX is provisioned through clusters, and you can add or remove nodes to scale capacity based on your application's needs.
Each cluster can have up to 10 nodes, providing high availability and fault tolerance.
Cost-Effective:
DAX is charged by the node-hour consumed, with pricing dependent on the instance type selected.
By reducing the read load on DynamoDB tables, DAX can help lower the provisioned read capacity on your DynamoDB tables, resulting in cost savings.
How DAX Works?
Cache Hit:
When an application requests an item, DAX first checks its in-memory cache.
If the item is found (cache hit), DAX returns the item directly to the application, resulting in microsecond response times.
Cache Miss:
If the item is not found in the cache (cache miss), DAX retrieves the item from DynamoDB using an Eventually Consistent GetItem operation.
The item is then stored in the cache for future requests.
Use Cases
Read-Heavy Workloads: Applications that perform frequent read operations can benefit from DAX's in-memory caching to reduce latency and improve response times.
Bursty Workloads: Applications with sudden spikes in read requests, such as during flash sales or gaming events, can use DAX to handle increased load without performance degradation.
Session State Storage: DAX can be used to store session state data, providing fast access to session information for web applications.
DAX vs ElastiCache
DAX is optimized for DynamoDB.
DAX does not support lazy loading (uses write-through caching).
With ElastiCache you have more management overhead (e.g. invalidation).
With ElastiCache you need to modify application code to point to cache.