SAA-C03Chapter 137 of 189Objective 3.6

DynamoDB Accelerator (DAX)

This chapter covers DynamoDB Accelerator (DAX), a fully managed, highly available, in-memory cache for Amazon DynamoDB. DAX is critical for the SAA-C03 exam because it directly addresses performance optimization for read-heavy and bursty workloads, a common scenario in solution architecture. Expect 1-2 questions on DAX, focusing on its use cases, consistency model, and when to choose it over ElastiCache or DynamoDB Global Tables.

25 min read
Intermediate
Updated May 31, 2026

DAX: A Private Cache for Your Database

Imagine a large corporate library with a central archive room. Every time a researcher needs a book, they walk to the archive, find it, and bring it back. This takes time, especially if many researchers want the same popular book. Now, the library installs a small, locked bookcase at the front desk. This bookcase holds copies of the most requested books. When a researcher asks for a book, the librarian first checks the front bookcase. If it's there, she hands it over instantly — no trip to the archive. If not, she goes to the archive, retrieves the book, and also places a copy in the front bookcase for next time. The front bookcase is limited in size, so when it's full and a new book needs to be added, the oldest or least-used book is removed. The key point: the front bookcase is not the archive — it's a temporary, high-speed cache that reduces load on the archive and speeds up access for the most popular items. The librarian (DAX) manages this cache transparently to the researcher (your application). The researcher just asks for a book and gets it quickly, without knowing whether it came from the front bookcase or the archive.

How It Actually Works

What is DAX and Why Does It Exist?

Amazon DynamoDB Accelerator (DAX) is a fully managed, clustered, in-memory cache that sits between your application and DynamoDB. It delivers up to 10x performance improvement for read-intensive workloads by reducing response times from milliseconds to microseconds. DAX is designed specifically for DynamoDB — it caches the results of GetItem, BatchGetItem, Query, and Scan operations, as well as individual item caches for eventually consistent reads. It does NOT cache write operations (PutItem, UpdateItem, DeleteItem) directly; instead, it uses a write-through strategy: when you write to DynamoDB via DAX, the cache is updated synchronously.

How DAX Works Internally

DAX operates as a write-through cache with two primary caches: - Item cache: caches individual items retrieved by primary key (GetItem, BatchGetItem). - Query cache: caches the results of Query and Scan operations, including the full result set and the query parameters.

When an application sends a read request through a DAX endpoint, DAX first checks the item cache. If found (cache hit), it returns the item immediately. If not (cache miss), DAX sends the request to DynamoDB, stores the result in the cache, and returns it. For writes, DAX writes to DynamoDB first, then updates the cache synchronously (write-through). If the write fails, the cache is not updated.

DAX uses a cluster of nodes: a primary node and up to 9 read replicas (total 10 nodes). The primary handles writes and cache management; replicas can serve reads. DAX nodes communicate internally to maintain cache consistency. The cache uses a Least Recently Used (LRU) eviction policy when memory is full.

Key Components, Values, Defaults, and Timers

Node types: r5.large, r5.xlarge, r5.2xlarge, r5.4xlarge, r5.8xlarge, r5.12xlarge, r5.16xlarge, and the older r4 family. Memory ranges from 13 GB (r5.large) to 384 GB (r5.16xlarge).

Cluster size: 1 (single node) to 10 nodes (1 primary + up to 9 replicas).

Cache TTL: Default is 5 minutes (300 seconds) for both item and query caches. Configurable from 1 second to 24 hours. TTL is reset on every cache hit.

Write-through: Synchronous — write to DynamoDB, then update cache. If DynamoDB write fails, cache is not updated.

Consistency: DAX supports eventually consistent reads only. It does NOT support strongly consistent reads. This is a critical exam point.

Encryption: Supports encryption at rest (using AWS KMS) and in transit (TLS).

Subnet groups: DAX clusters must be launched in a VPC, and you must specify a subnet group with at least two subnets in different Availability Zones for high availability.

Security: Use IAM roles for access to DynamoDB; DAX needs an IAM role with permissions to DynamoDB and CloudWatch Logs. Client applications authenticate via IAM credentials or EC2 instance profiles.

Configuration and Verification Commands

Creating a DAX cluster via AWS CLI:

aws dax create-cluster \
    --cluster-name my-dax-cluster \
    --node-type dax.r5.large \
    --replication-factor 3 \
    --iam-role-arn arn:aws:iam::123456789012:role/DAXServiceRole \
    --subnet-group-name my-subnet-group \
    --security-group-ids sg-12345678

Verifying cluster status:

aws dax describe-clusters --cluster-name my-dax-cluster

Testing connectivity from an EC2 instance (DAX client SDK required):

import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder;
import com.amazonaws.services.dynamodbv2.document.DynamoDB;
import com.amazonaws.services.dynamodbv2.document.Item;

AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
    .withEndpointConfiguration(
        new AwsClientBuilder.EndpointConfiguration("dax://my-dax-cluster.abcdef.clustercfg.dax.use1.cache.amazonaws.com:8111", "us-east-1"))
    .build();
DynamoDB dynamoDB = new DynamoDB(client);
Item item = dynamoDB.getTable("MyTable").getItem("pk", "value");

Interaction with Related Technologies

DynamoDB: DAX is tightly coupled with DynamoDB. It caches DynamoDB responses but does not replace it. DAX cannot be used with DynamoDB Global Tables (cross-region replication) because Global Tables require strongly consistent writes, and DAX only supports eventually consistent reads.

ElastiCache: ElastiCache (Redis/Memcached) is a general-purpose cache that can be used with DynamoDB, but it requires manual cache invalidation logic. DAX is purpose-built for DynamoDB and automatically manages cache invalidation on writes. For exam questions, if the scenario involves caching DynamoDB reads, DAX is almost always the better choice unless the application needs a generic cache for multiple data sources.

Lambda: DAX can be accessed from Lambda functions within the same VPC. Lambda must have a VPC configuration with the appropriate security group and subnet routes to the DAX cluster.

CloudWatch: DAX publishes metrics like CacheHitCount, CacheMissCount, Evictions, and CPUUtilization. You can set alarms for high eviction rates (indicating insufficient node size).

Exam-Specific Details

DAX is only for eventually consistent reads. If your application requires strongly consistent reads, you must bypass DAX and read directly from DynamoDB.

DAX does not cache Scan results if the scan exceeds the cache size or if the query uses FilterExpression that is not deterministic.

DAX clusters are not multi-region. They operate within a single region and VPC.

DAX supports automatic failover: if the primary node fails, one of the replicas is promoted to primary.

DAX uses a cluster endpoint that automatically routes requests to the primary node for writes and any node for reads (if configured).

The default TTL of 5 minutes can be adjusted, but a very short TTL reduces cache effectiveness, while a very long TTL risks serving stale data.

Common Pitfalls

Using DAX with strongly consistent reads: DAX returns eventually consistent data even if the application requests strong consistency. The request is downgraded to eventual consistency.

Assuming DAX caches writes: DAX does not cache write operations; it only updates the cache after a successful write to DynamoDB. If you read immediately after a write, you might get the old cached value until the write-through completes.

Overlooking VPC configuration: DAX must be in the same VPC as your application. If your Lambda or EC2 is in a different VPC, you need VPC peering or a transit gateway.

Ignoring TTL: Large TTL values can cause stale data if the underlying DynamoDB item is changed by another application that does not use DAX.

Walk-Through

1

Application Sends Read Request

The application sends a read request (e.g., GetItem, Query) to the DAX cluster endpoint. The request is routed to a DAX node. DAX uses an internal hash of the partition key to determine which node (if multiple) should handle the request, but since DAX is a cluster, any node can serve reads. The request includes the table name, key attributes, and optionally a consistent read flag (which DAX ignores).

2

DAX Checks Item Cache

DAX first checks its item cache for the requested item. The cache is keyed by the table name and primary key. If the item is found (cache hit), DAX updates the item's last-access timestamp for LRU tracking and resets its TTL timer. DAX then returns the item to the application immediately, without contacting DynamoDB. This typically takes microseconds.

3

Cache Miss: DAX Queries DynamoDB

If the item is not in the cache (cache miss), DAX sends the request to DynamoDB. DAX uses its IAM role to authenticate to DynamoDB. DynamoDB processes the request and returns the item. DAX receives the item, records it in the item cache with the current timestamp and TTL, and then returns it to the application. The cache miss adds DynamoDB latency (typically single-digit milliseconds).

4

Application Sends Write Request

When the application sends a write request (PutItem, UpdateItem, DeleteItem) to the DAX endpoint, DAX forwards it to DynamoDB synchronously. DAX waits for DynamoDB to acknowledge the write (success or failure). If successful, DAX updates its cache: for PutItem, it stores the new item; for UpdateItem, it updates the cached item; for DeleteItem, it removes the item from the cache. If DynamoDB returns an error, the cache is not modified.

5

Cache Eviction and TTL Expiry

DAX manages cache size using LRU eviction. When the cache reaches its memory limit, DAX evicts the least recently accessed items. Additionally, each cached item has a TTL (default 300 seconds). When the TTL expires, the item is invalidated and removed from the cache on the next access (lazy expiration). A background process may also periodically clean expired entries. Evictions and expirations force a cache miss on subsequent reads.

What This Looks Like on the Job

Enterprise Scenario 1: Gaming Leaderboards

A mobile gaming company uses DynamoDB to store player scores and leaderboards. During peak hours, thousands of players query the top 100 scores every second. Without caching, each query triggers a Scan with a SortKey condition, causing high DynamoDB read capacity consumption and latency spikes. The company deploys a DAX cluster with three r5.large nodes (one primary, two replicas) in the same VPC as their game servers. They set the query cache TTL to 10 seconds, balancing freshness with performance. Result: read latency drops from 5 ms to under 100 µs, and DynamoDB read capacity usage decreases by 70%. Misconfiguration: initially, they set the TTL to 60 seconds, causing players to see stale scores for too long, leading to complaints. They reduced TTL to 10 seconds after monitoring cache hit rates and staleness.

Enterprise Scenario 2: E-Commerce Product Catalog

An e-commerce platform stores product details (price, description, inventory count) in DynamoDB. The product catalog is read-heavy, with frequent updates to inventory during checkout. They use DAX with write-through to ensure that inventory changes are reflected immediately in the cache. However, they also have a separate reporting application that reads directly from DynamoDB, bypassing DAX. This causes cache inconsistency: after a direct update by the reporting app, DAX still serves stale data until TTL expiry. They solve this by either routing all writes through DAX or implementing a cache invalidation mechanism via DynamoDB Streams and Lambda to purge the relevant DAX cache entries. They chose the latter, using a Lambda function that listens to DynamoDB Streams and calls the DAX DeleteItem API to remove the stale item from the cache.

Enterprise Scenario 3: Financial Trading Dashboard

A financial firm uses DynamoDB to store real-time stock prices. The dashboard updates every second and requires strongly consistent reads to avoid showing stale prices. Initially, they tried using DAX for lower latency, but DAX only supports eventually consistent reads, so traders saw outdated prices during high volatility. They removed DAX and instead provisioned higher read capacity on DynamoDB, using DAX only for non-critical historical data queries. This teaches an important lesson: DAX is not suitable for workloads that demand strong consistency. The exam often tests this distinction.

How SAA-C03 Actually Tests This

What SAA-C03 Tests on DAX

The exam focuses on DAX's purpose, consistency model, and when to choose it over alternatives. Key objective codes: Domain 3 (High Performance), Objective 3.6 (Implement caching strategies). Expect questions that present a scenario with read-heavy DynamoDB workloads and ask which service improves performance. Common traps:

1.

Choosing ElastiCache over DAX: Candidates often pick ElastiCache because they know it's a cache. However, DAX is purpose-built for DynamoDB and requires no application-level cache management. The exam expects you to recognize that DAX is the simpler and more efficient choice for DynamoDB.

2.

Assuming DAX supports strongly consistent reads: This is the #1 trap. Many candidates think DAX caches all reads, but DAX only caches eventually consistent reads. If the scenario requires strong consistency, the answer should be to not use DAX or to use DynamoDB directly with strong consistency.

3.

Believing DAX caches writes: DAX does not cache write operations; it only updates the cache after a successful write. A question might describe a scenario where a write is sent to DAX and the application expects an immediate cache hit — this will not happen until after the write completes.

4.

Overlooking VPC requirements: DAX must be in the same VPC as the application. If the question describes an on-premises application accessing DynamoDB via a VPN, DAX is not an option unless the application is migrated to the VPC.

Specific Numbers and Terms

Default TTL: 300 seconds (5 minutes)

Maximum nodes: 10

Node types: dax.r5.* (not just r5)

Port: 8111 (for DAX client)

Cache types: item cache and query cache

Consistency: eventually consistent only

Write policy: write-through

Eviction: LRU

Edge Cases

DAX cannot be used with DynamoDB Global Tables because Global Tables require strongly consistent writes and cross-region replication, which DAX does not support.

DAX does not cache responses for TransactGetItems or TransactWriteItems — these are passed through to DynamoDB.

If you use DAX with DynamoDB Streams, the stream records are unaffected; DAX does not interfere.

How to Eliminate Wrong Answers

If the question mentions consistent reads, look for an answer that avoids DAX or uses DynamoDB directly.

If the question mentions caching for multiple data sources (e.g., RDS and DynamoDB), ElastiCache might be appropriate, not DAX.

If the question mentions low latency for reads and writes, consider that DAX only helps reads; writes still go to DynamoDB.

If the question involves a serverless architecture with Lambda, ensure the Lambda function is in the same VPC to access DAX.

Key Takeaways

DAX provides up to 10x performance improvement for read-heavy DynamoDB workloads by caching at microsecond latency.

DAX supports only eventually consistent reads; strongly consistent reads must bypass DAX.

DAX uses a write-through cache: writes go to DynamoDB first, then update the cache synchronously.

Default TTL for cached items is 300 seconds (5 minutes); configurable from 1 second to 24 hours.

DAX clusters can have 1-10 nodes (1 primary + up to 9 replicas) and must be in the same VPC as the application.

DAX cannot be used with DynamoDB Global Tables or for caching TransactGetItems/TransactWriteItems.

Cache eviction is LRU (Least Recently Used) when memory is full.

DAX is not a replacement for DynamoDB; it is an optional cache layer that can be bypassed.

For exam scenarios requiring low-latency reads on DynamoDB, DAX is the preferred solution over ElastiCache.

DAX clusters are single-region; cross-region caching requires separate DAX clusters in each region.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

DynamoDB Accelerator (DAX)

Purpose-built for DynamoDB; no application-level cache management needed.

Supports write-through caching automatically for DynamoDB writes.

Only caches DynamoDB data; cannot cache other data sources.

Supports eventually consistent reads only.

Simpler to set up for DynamoDB caching; uses a DAX client SDK.

Amazon ElastiCache (Redis/Memcached)

General-purpose cache; can be used with any database (DynamoDB, RDS, etc.).

Requires manual cache invalidation logic for DynamoDB writes.

Can cache any data structure (strings, hashes, lists) from any source.

Supports strongly consistent reads if the application manages consistency.

More flexible but requires more development effort to integrate with DynamoDB.

Watch Out for These

Mistake

DAX supports strongly consistent reads.

Correct

DAX only supports eventually consistent reads. If an application requests strongly consistent reads, DAX silently downgrades them to eventually consistent. For strong consistency, you must bypass DAX and read directly from DynamoDB using the `ConsistentRead=true` parameter.

Mistake

DAX caches the results of write operations.

Correct

DAX does not cache write operations themselves. It uses a write-through policy: when a write is sent to DAX, it forwards the write to DynamoDB, and only after a successful response does it update the cache. The write operation itself is not cached.

Mistake

DAX can be used across multiple AWS regions.

Correct

DAX clusters are single-region and single-VPC. They cannot span regions. For cross-region caching, you would need separate DAX clusters in each region or use DynamoDB Global Tables with local caching.

Mistake

DAX is a drop-in replacement for DynamoDB.

Correct

DAX is a cache that sits in front of DynamoDB. It is not a database itself. If DAX fails or is not reachable, the application can still read/write directly to DynamoDB (if configured). DAX is optional and transparent to the application logic.

Mistake

DAX caches all DynamoDB read operations.

Correct

DAX caches GetItem, BatchGetItem, Query, and Scan results. However, it does not cache results from TransactGetItems, PartiQL queries, or operations that use FilterExpression that are non-deterministic (e.g., using `#` in filter expressions). Also, Scan results are only cached if the entire result set fits in the cache.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

Can DAX be used with strongly consistent reads?

No, DAX only supports eventually consistent reads. If you send a request with `ConsistentRead=true`, DAX will ignore that flag and return eventually consistent data from its cache or from DynamoDB. For strongly consistent reads, you must read directly from DynamoDB without using DAX. On the exam, if a scenario requires strong consistency, DAX is not the answer.

How does DAX handle cache invalidation on writes?

DAX uses a write-through strategy. When a write operation (PutItem, UpdateItem, DeleteItem) is sent to the DAX endpoint, DAX first forwards the write to DynamoDB. Only after DynamoDB confirms success does DAX update its cache: for PutItem, it stores the new item; for UpdateItem, it updates the cached item; for DeleteItem, it removes the item. If the DynamoDB write fails, the cache is not modified. This ensures that the cache is always consistent with DynamoDB for writes that go through DAX.

What happens if DAX cluster fails?

If the DAX cluster becomes unavailable, your application should have fallback logic to read directly from DynamoDB. The DAX client SDK can be configured to fall back to DynamoDB on failure. DAX itself is highly available: it runs in a cluster with automatic failover. If the primary node fails, one of the replicas is promoted to primary within seconds. However, during failover, there may be a brief period of unavailability. It's best practice to implement a retry mechanism with fallback to DynamoDB.

Can I use DAX with Lambda functions?

Yes, but your Lambda function must be configured to access the VPC where the DAX cluster resides. This means you need to assign the Lambda function to the same VPC, subnets, and security groups as the DAX cluster. The Lambda function's IAM role must have permissions for `dax:GetItem`, `dax:PutItem`, etc. Note that Lambda cold starts may be slightly slower due to VPC initialization, but this is usually acceptable.

Does DAX support encryption?

Yes, DAX supports encryption at rest using AWS KMS and encryption in transit using TLS. When you create a DAX cluster, you can specify a KMS key for encryption at rest. Encryption in transit is enabled by default for DAX client connections (port 8111). You must use the DAX client SDK which supports TLS.

How do I choose between DAX and ElastiCache for DynamoDB caching?

If your only goal is to cache DynamoDB read operations, DAX is the simpler and more efficient choice because it requires no custom cache management code. Use ElastiCache if you need a general-purpose cache for multiple data sources (e.g., caching both DynamoDB and RDS results), if you need to cache complex data structures not supported by DAX, or if you need features like Redis Sorted Sets or Pub/Sub. On the exam, if the scenario mentions DynamoDB reads specifically, DAX is usually the correct answer.

Terms Worth Knowing

Ready to put this to the test?

You've just covered DynamoDB Accelerator (DAX) — now see how well it sticks with free SAA-C03 practice questions. Full explanations included, no account needed.

Done with this chapter?