NoSQL Database Caching with Amazon DynamoDB Accelerator (DAX). Q&A with Santosh Rao.
Q1. Can you help me understand what is database caching?
A1. In computing, a cache is a high-speed data storage layer that stores a subset of data in memory. Caches are typically transient in nature, so that future requests for that data are served up faster than is possible by accessing the data’s primary storage location. A database cache’s primary purpose is to increase data retrieval performance by reducing the need to access the underlying database layer.
Q2. What are some benefits of database caching? Why would customers want to use a database cache?
A2. A common challenge in modern applications is dealing with spikes in application usage. Examples include social apps during the Super Bowl or election day or e-commerce websites during Black Friday. Such application usage spikes can translate to increased read loads on a subset of the data. A cache can be effective in serving frequently accessed data at microsecond latencies resulting in predictable performance across spikes in usage.
Because memory is an order of magnitude faster than disk, reading data from in-memory cache is extremely fast (sub-millisecond). This significantly faster data access improves the overall performance of the application. A database cache can offload hundreds of thousands of read requests from a database, instead, serving these requests out of cache. Reducing read requests to a database can reduce cost especially if the databases charges per read operation or by throughput in general.
Q3. What is the database caching offered for Amazon DynamoDB?
A2. Amazon DynamoDB is a fast, flexible NoSQL database service for single-digit millisecond performance at any scale used by customers such as Disney, Dropbox, Snap, and Zoom. Amazon DynamoDB offers a native caching capability called DynamoDB Accelerator (DAX). DAX is a fully managed, highly available, in-memory cache for Amazon DynamoDB that delivers up to a 10 times performance improvement—from milliseconds to microseconds—even at millions of requests per second. DAX does all the heavy lifting required to add in-memory acceleration to your DynamoDB tables, without requiring developers to manage cache invalidation, data population, or cluster management.
Customers can focus on building great applications without worrying about performance at scale. You do not need to modify application logic because DAX is compatible with existing DynamoDB API calls. You can enable DAX with just a few clicks in the AWS Management Console or by using the AWS SDK.
Q4. What are some use cases for DAX? Where should customers consider using DAX?
A4. DAX is ideal for applications that need the fastest possible read response times. Some examples include real-time advertisement bidding, social gaming, and trading applications. DAX delivers fast in-memory read performance for these use cases.
Another good use case is for applications that read a small number of items more frequently than others. For example, an e-commerce system running a one-day sale on a popular product may experience a sharp increase in demand for that product. To mitigate the impacts of such non-uniform traffic distribution, you can offload the read activity to a DAX cache until the one-day sale is over.
A popular use case is to optimize for cost. With DynamoDB, you provision and pay for the number of reads per second that your application requires. By offloading reads to DAX, customers can reduce the number of DynamoDB read capacity units they need to purchase otherwise.
Lastly, DAX can be used to improve read throughput for applications that have to perform repeat reads against a number of items. An example is a long-running analysis of regional weather data that could temporarily consume all the read capacity in a DynamoDB table. With DAX, the weather analysis could be performed against cached data instead.
Q5. What are some use cases where DAX is not a good fit and should not be used?
A4. DAX is not a good fit for applications that require strongly consistent reads. Strongly consistent read requests are passed on to DynamoDB and are not served from cache, thus seeing no performance benefit from DAX.
Another use case where DAX is not applicable are applications that do not require microsecond response times for reads or that do not need to offload repeated read activity from underlying tables. Likewise, applications that are write intensive and do not perform much read activity would not benefit from DAX.
Q6. How do customers use DAX?
A6. DAX is tightly integrated with DynamoDB. Customers simply provision a DAX cluster, use the DAX client SDK to point their existing DynamoDB API calls at the DAX cluster, and let DAX handle the rest. Because DAX is API-compatible with DynamoDB, customers do not have to make any functional application code changes. DAX does the heavy lifting behind the scenes to deliver improved performance. Furthermore, because the retrieval of cached data reduces the read load on existing DynamoDB tables, customers may also be able to reduce their provisioned read capacity and lower overall operational costs. DAX is a write-through cache. Writes are passed through to DynamoDB and the cache is kept updated on successful writes.
Q7. What makes DAX unique amongst the many database cache offerings available?
A7. DAX is API compatible with Amazon DynamoDB. This means that customers do not have to develop separate application code to write to the caching layer. Ease of application development is possible as well as selective use of DAX for the right fit use cases with no additional application code.
Q8. What are some examples of how customers are using DAX?
Customers like Tinder, Canon Inc., Careem are users of DAX and like the ability to use DAX without writing any new application code as it provides DynamoDB API compatibility. Canon Inc. saves cost by using DAX as they can use fewer DynamoDB capacity units while improving data access speed with DAX. Careem is impressed with DAX built-in failover and replication capability.
Qx. Anything else you wish to add?
Ax. To get started with DAX from an application, you can use the DAX SDK for your programming language. To learn more, you can review a list of supported DAX SDKs here.
DAX is fully managed, tightly integrated with DynamoDB, offers microsecond latencies for read-heavy workloads, offers maximal flexibility and enhanced security. With just a few clicks, customers can achieve an order of magnitude performance improvement, potentially reduce costs while achieving and maintain predictable performance at scale. To learn more visit https://aws.amazon.com/dynamodb/dax/ to get started.
Santosh Rao is a Principal in Product Management for Amazon DynamoDB at Amazon Web Services. His focus areas include high availability, disaster recovery, caching, multi-Region databases. Prior to AWS, Santosh Rao was a Senior Director at NetApp for 12 years and led to market various products including NetApp’s AI Data Platform, NoSQL, Distributed SAN and NAS platforms. Prior to that, he held engineering leadership roles for 10 years at Hewlett Packard.
Sponsored by AWS.