← Back to Index
Chapter 06 of 20

Amazon DynamoDB

Domain 3 — High-Performing Architectures (24%)
Question 1Knowledge

An application needs DynamoDB reads that always reflect the latest committed write, even if a write just occurred milliseconds ago. Which read consistency type should be used?

Explanation

DynamoDB offers two read consistency options: Eventually Consistent (default, 50% the cost of strongly consistent) may return slightly stale data. Strongly Consistent reads always reflect the latest data but consume more read capacity units and have slightly higher latency. Strong consistency is not available for Global Secondary Indexes.

Question 2Scenario

A company's DynamoDB table experiences unpredictable traffic with sudden spikes several times a day. The team wants AWS to automatically manage read and write capacity. Which capacity mode is BEST?

Explanation

On-Demand mode charges per request and instantly accommodates any traffic level without throttling. It is ideal for unpredictable workloads. Provisioned mode with Auto Scaling reacts to sustained traffic changes but may throttle during sudden spikes. On-Demand can be up to 2.5× more expensive per request than provisioned at steady-state loads.

Question 3Scenario

A gaming leaderboard application needs to cache frequently accessed DynamoDB items with single-digit microsecond latency. Which AWS service is purpose-built for this use case?

Explanation

DAX is a fully managed, highly available, in-memory cache for DynamoDB. It is API-compatible with DynamoDB, so minimal code changes are needed. DAX delivers up to 10× read performance improvement and reduces DynamoDB read capacity consumption. Ideal for read-heavy workloads like leaderboards, product catalogs, and session stores.

Question 4Knowledge

Which DynamoDB feature enables active-active multi-region replication, allowing reads and writes in multiple AWS regions simultaneously?

Explanation

DynamoDB Global Tables create replica tables in multiple AWS regions. All replicas are writable (active-active). Changes are propagated with sub-second replication latency. Conflict resolution uses "last writer wins" semantics. Global Tables require DynamoDB Streams to be enabled and are built on top of it internally.

Question 5Scenario

A financial application needs to atomically debit one DynamoDB item and credit another item in a different table. If either operation fails, neither should be committed. Which DynamoDB feature provides this?

Explanation

DynamoDB Transactions support ACID properties. TransactWriteItems performs up to 100 write actions across one or more tables atomically. If any condition fails, the entire transaction is rolled back. Transactions consume 2× the normal write capacity units. They are ideal for financial operations, inventory management, and order processing.