How to Master DynamoDB: Complete Cheatsheet for AWS Developer Exam
By Braincuber Team
Published on April 13, 2026
The emergence of cloud services has changed the way we build web-applications. DynamoDB is the most important AWS service to study to pass the AWS Developer Associate exam. This complete tutorial provides a comprehensive cheatsheet covering everything you need to know about Amazon DynamoDB.
What You'll Learn:
- How DynamoDB works as a fully managed NoSQL database
- Step by step guide to understanding reads and writes consistency
- Beginner guide to partitions and primary key design
- How to use GSI and LSI secondary indexes
- Complete tutorial on Provisioned vs On-Demand capacity modes
- How to calculate RCUs and WCUs for your workload
- Complete tutorial on DynamoDB Accelerator (DAX)
The Basics of DynamoDB
DynamoDB is a fully managed NoSQL key/value and document database. It is suited for workloads with any amount of data that require predictable read and write performance and automatic scaling from large to small and everywhere in between.
Fully Managed
No server maintenance required. AWS handles all infrastructure, backups, and scaling automatically.
Automatic Scaling
Scales up and down to support whatever read and write capacity you specify per second.
High Durability
Stores 3 copies of data on SSD drives across 3 Availability Zones in a region.
Key-Value & Document
Supports both key-value and document data models. Most common datatypes are B (Binary), N (Number), and S (String).
| Concept | Description |
|---|---|
| Table | Collection of items with primary key for identification |
| Items | Rows in a table |
| Attributes | Columns in a table |
Reads and Writes Consistency
DynamoDB can be set to support Eventually Consistent Reads (default) and Strongly Consistent Reads on a per-call basis.
Eventually Consistent Reads (Default)
Data is returned immediately but data can be inconsistent. Copies of data will be generally consistent in 1 second. This provides lower latency but may return stale data.
Strongly Consistent Reads
Will always read from the leader partition since it always has an up-to-date copy. Data will never be inconsistent but latency may be higher.
Partitions and Primary Key Design
A Partition is when DynamoDB slices your table up into smaller chunks of data. This speeds up reads for very large tables. DynamoDB automatically creates partitions for every 10 GB of data or when you exceed RCUs (3000) or WCUs (1000) limits for a single partition.
| Key Type | Alternative Name | Description |
|---|---|---|
| Partition Key | HASH | Determines which partition data is stored in |
| Sort Key | RANGE | Orders items within the same partition |
Primary Key Types
Simple Primary Key: Uses only a Partition Key (PK value must be unique). Composite Primary Key: Uses both Partition and Sort Key (combined PK and SK must be unique).
Secondary Indexes: GSI vs LSI
DynamoDB has two types of secondary indexes that allow you to query data using alternative key patterns.
Local Secondary Index (LSI)
Can only be created with initial table. Supports strongly or eventual consistency. Must share Partition Key with base table. Limited to 10GB per partition. Shares capacity units with base table.
Global Secondary Index (GSI)
Can create, modify, or delete at anytime. Only eventual consistency reads. Has its own capacity settings. Can have any attributes as Primary or Sort Key. No size restriction per partition.
Scan vs Query
| Operation | Use Case | Notes |
|---|---|---|
| Query | Find items based on primary key values | Table must have composite key. Default eventual consistency. Sorted ascending by default. |
| Scan | Access every item in table | Expensive and slow. Use sparingly. Can use parallel scans with Segments and Total Segments. |
Design Best Practice
Your table(s) should be designed so your workload primary access patterns do not use Scans. Overall, scans should be needed sparingly, for example for an infrequent report.
Capacity Modes
DynamoDB has two capacity modes: Provisioned and On-Demand. You can switch between these modes once every 24 hours.
Provisioned Capacity Mode
Step by step guide to provisioned throughput. Maximum amount of capacity your application is allowed to read or write per second. Suited for predictable or steady state workloads. RCUs (Read Capacity Unit) and WCUs (Write Capacity Unit) must be specified.
On-Demand Capacity Mode
Beginner guide to pay-per-request pricing. Suited for new or unpredictable workloads. Throughput limited to default upper limits (40K RCUs and 40K WCUs). Throttling can occur if you exceed double your previous peak capacity within 30 minutes.
You should enable Auto Scaling with Provisioned capacity mode.
Set a floor and ceiling for capacity.
DynamoDB will automatically add and remove capacity between these values.
Throttle calls that go above the ceiling for too long.
Calculating RCUs and WCUs
Calculating Read Capacity Units (RCU)
A read capacity unit represents one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4 KB in size.
Strongly Consistent Read Formula
Step by step guide: Round data up to nearest 4, divide by 4, times by number of reads. Example: 50 reads at 40KB = (40/4) x 50 = 500 RCUs
Eventually Consistent Read Formula
Beginner guide: Round up to 4KB, divide by 4, times by reads, divide by 2. Example: 50 reads at 40KB = (40/4) x 50 / 2 = 250 RCUs
Calculating Write Capacity Units (WCU)
A write capacity unit represents one write per second for an item up to 1 KB.
// Formula: Round data up to nearest 1, times by number of writes
// Example 1: 50 writes at 40KB = 40 x 50 = 2000 WCUs
// Example 2: 11 writes at 1KB = 1 x 11 = 11 WCUs
// Example 3: 18 writes at 500 bytes = 1 x 18 = 18 WCUs
DynamoDB Accelerator (DAX)
DynamoDB Accelerator (DAX) is a fully managed in-memory write-through cache for DynamoDB that runs in a cluster. DAX can reduce read response times to microseconds.
DAX is Ideal For
Fastest response times possible. Apps that read a small number of items more frequently. Apps that are read intensive.
DAX is Not Ideal For
Apps requiring strongly consistent reads. Apps not needing microsecond response times. Write intensive apps. Consider ElastiCache instead.
DynamoDB API Commands
| Command | Description |
|---|---|
| aws dynamodb get-item | Returns attributes for item with given primary key |
| aws dynamodb put-item | Creates new item or replaces old item |
| aws dynamodb update-item | Edits existing item attributes or adds new item |
| aws dynamodb batch-get-item | Retrieves up to 16 MB of data (100 items max) |
| aws dynamodb batch-write-item | Puts or deletes up to 16 MB (25 requests max) |
| aws dynamodb create-table | Adds new table to account |
| aws dynamodb query | Finds items based on primary key values |
| aws dynamodb scan | Returns one or more items (accesses every item) |
| aws dynamodb transact-get-items | Atomically retrieves up to 25 items (4 MB max) |
| aws dynamodb transact-write-items | Groups up to 25 action requests |
Advanced DynamoDB Features
DynamoDB Transactions
Complete tutorial on transactions via TransactWriteItems and TransactGetItems API. Transactions let you query multiple tables at once with an all-or-nothing approach.
Global Tables
Step by step guide to deploying multi-region, multi-master databases. Provides fully managed solution for global deployments.
DynamoDB Streams
Beginner guide to setting up Lambda functions triggered when data is modified. Streams do not consume RCUs.
Frequently Asked Questions
What is the difference between GSI and LSI?
GSI (Global Secondary Index) can be created/modified anytime and has its own capacity. LSI (Local Secondary Index) can only be created with the table and shares capacity with the base table.
When should I use On-Demand vs Provisioned capacity?
Use Provisioned for predictable workloads where you can estimate capacity needs. Use On-Demand for new or unpredictable workloads where you want to pay per request.
What is DAX and when should I use it?
DAX (DynamoDB Accelerator) is an in-memory cache that reduces read latency to microseconds. Use it for read-intensive apps requiring the fastest possible response times.
How do I calculate RCUs for my workload?
For strongly consistent reads: round up to 4KB, divide by 4, multiply by reads. For eventually consistent, divide that result by 2.
Should I use Scan or Query for my application?
Always prefer Query over Scan when possible. Query uses primary keys and is efficient. Scan accesses every item and should only be used for infrequent operations.
Need Help with AWS Certification?
Preparing for the AWS Developer Associate exam? Our experts can help you understand DynamoDB concepts and other AWS services. We offer mentorship and consultation to help you pass your certification.
