DynamoDB Basics Interview Questions
Master Amazon DynamoDB fundamentals with interview-focused questions and answers covering architecture, tables, items, partition keys, sort keys, CRUD operations, consistency, DAX, Global Tables, TTL, backups, and production best practices.
Introduction
Amazon DynamoDB is a fully managed, serverless NoSQL database service provided by AWS. It is designed to deliver single-digit millisecond latency at virtually any scale while automatically handling infrastructure management, replication, scaling, backups, and fault tolerance.
Many of the world's largest applications use DynamoDB because it provides:
- Unlimited Scalability
- High Availability
- Low Latency
- Fully Managed Infrastructure
- Serverless Operations
Companies including Amazon, Netflix, Airbnb, Lyft, Samsung, Capital One, Disney+, Snap, and Roblox use DynamoDB for mission-critical workloads.
This guide covers the most frequently asked DynamoDB interview questions for Java Developers, Cloud Engineers, Backend Engineers, DevOps Engineers, and Solution Architects.
DynamoDB Architecture
flowchart LR
Application --> API --> DynamoDB
DynamoDB --> Partitions
Partitions --> SSDStorage
DynamoDB --> Replication
Replication --> MultipleAZs
1. What is Amazon DynamoDB?
Answer
Amazon DynamoDB is a
- Fully Managed
- Serverless
- NoSQL
- Key-Value
- Document Database
that provides
- Automatic Scaling
- High Availability
- Low Latency
- Multi-AZ Replication
without requiring infrastructure management.
2. Why was DynamoDB created?
Traditional databases required
- Server Management
- Manual Scaling
- Capacity Planning
- Replication Configuration
- Backup Management
DynamoDB eliminates these operational tasks by providing a managed database service.
3. What type of database is DynamoDB?
DynamoDB is
- NoSQL Database
- Key-Value Database
- Document Database
- Fully Managed Cloud Database
4. What are the key features of DynamoDB?
- Serverless
- Fully Managed
- Automatic Scaling
- Multi-AZ Replication
- Low Latency
- High Availability
- On-Demand Capacity
- Global Tables
- Encryption at Rest
- Point-in-Time Recovery
5. What are common DynamoDB use cases?
- User Profiles
- Shopping Carts
- Session Management
- Banking Applications
- Gaming Leaderboards
- IoT Applications
- Event Logging
- Recommendation Systems
6. DynamoDB vs Relational Database?
| DynamoDB | RDBMS |
|---|---|
| NoSQL | Relational |
| Serverless | Self Managed |
| Automatic Scaling | Manual Scaling |
| Schema Flexible | Fixed Schema |
| No JOINs | JOIN Supported |
| Millisecond Latency | Depends on Workload |
7. DynamoDB vs Cassandra?
| DynamoDB | Cassandra |
|---|---|
| Fully Managed | Self Managed |
| AWS Service | Open Source |
| Serverless | Cluster Management |
| Automatic Scaling | Manual Scaling |
| Global Tables | Multi-DC Replication |
8. What is Serverless?
Serverless means
AWS manages
- Servers
- Scaling
- Backups
- Replication
- Maintenance
Developers focus only on application development.
9. What is a Table?
A Table stores related items.
Example
Customer
Order
Employee
10. What is an Item?
An Item represents a single record.
Equivalent to
Row
in relational databases.
Example
{
"CustomerId":"1001",
"Name":"Venugopal",
"City":"San Antonio"
}
11. What is an Attribute?
Attributes are fields inside an item.
Example
CustomerId
Name
City
Salary
12. What is a Primary Key?
Every DynamoDB table requires a primary key.
Types
- Partition Key
- Composite Primary Key
13. What is a Partition Key?
Partition Key determines
- Data Distribution
- Physical Partition
- Storage Location
Example
CustomerId
Partition Flow
flowchart LR
CustomerId --> HashFunction --> Partition --> StorageNode
14. What is a Sort Key?
Sort Key determines ordering within a partition.
Example
OrderDate
15. What is a Composite Primary Key?
Combination of
Partition Key
+
Sort Key
Example
CustomerId
+
OrderDate
16. Explain DynamoDB Data Types.
Scalar
- String
- Number
- Binary
- Boolean
- Null
Document
- List
- Map
Set
- String Set
- Number Set
- Binary Set
17. Does DynamoDB support nested JSON?
Yes.
Example
{
"Address": {
"City":"San Antonio",
"State":"Texas"
}
}
18. CRUD Operations
Create
PutItem
Read
GetItem
Update
UpdateItem
Delete
DeleteItem
19. Difference between Query and Scan?
| Query | Scan |
|---|---|
| Uses Key | Reads Entire Table |
| Fast | Slow |
| Low Cost | Expensive |
| Production Ready | Avoid When Possible |
20. What is Conditional Write?
Writes succeed only if a condition is true.
Example
attribute_not_exists(CustomerId)
Useful for preventing duplicate records.
21. What are Batch Operations?
Supported APIs
- BatchGetItem
- BatchWriteItem
Benefits
- Reduced Network Calls
- Better Performance
22. What is TTL?
TTL
Time To Live
Automatically deletes expired items.
Example
Session Data
Expires after
24 Hours
23. What is Point-in-Time Recovery (PITR)?
Allows restoring a table to any second within the retention window.
Benefits
- Recover Deleted Data
- Recover Corrupted Data
- Disaster Recovery
24. How are backups handled?
Supported
- On-Demand Backup
- Automated Backup
- PITR
25. What are Global Tables?
Global Tables replicate data across AWS Regions.
Benefits
- Multi-Region Applications
- Low Latency
- Disaster Recovery
Global Tables
flowchart LR
US-East
<--> Europe
Europe
<--> Asia
26. What is DynamoDB Accelerator (DAX)?
DAX is an in-memory cache for DynamoDB.
Benefits
- Microsecond Reads
- Lower Read Latency
- Reduced DynamoDB Read Requests
27. Does DynamoDB encrypt data?
Yes.
Supports
- AWS KMS
- Encryption at Rest
- Encryption in Transit
28. What consistency models does DynamoDB support?
- Eventually Consistent Reads
- Strongly Consistent Reads
Eventually Consistent is the default.
29. What are common limitations?
- No JOINs
- No Stored Procedures
- Limited Aggregations
- Query-Based Design
- Hot Partition Risk
30. Real Production Example
A banking application stores customer transactions.
Primary Key
CustomerId
Sort Key
TransactionTime
Benefits
- Fast Customer History
- Millisecond Reads
- Automatic Scaling
- Multi-Region Replication
DynamoDB Request Flow
flowchart LR
Application --> PartitionKey --> HashFunction --> Partition --> Replication --> Response
Enterprise Best Practices
- Design tables around access patterns.
- Choose high-cardinality partition keys.
- Prefer Query over Scan.
- Enable Auto Scaling.
- Enable Point-in-Time Recovery.
- Enable Encryption using AWS KMS.
- Use TTL for temporary data.
- Use DAX for read-heavy workloads.
- Monitor CloudWatch metrics.
- Avoid hot partitions.
Quick Revision
| Topic | Key Point |
|---|---|
| Database | NoSQL |
| Type | Key-Value + Document |
| Management | Fully Managed |
| Scaling | Automatic |
| Storage | Serverless |
| Primary Key | Partition or Composite |
| Read API | GetItem |
| Write API | PutItem |
| Query | Fast |
| Scan | Slow |
| Cache | DAX |
| Backup | PITR |
| Multi-Region | Global Tables |
| Encryption | AWS KMS |
Interview Tips
Interviewers commonly ask
- Why DynamoDB over RDS?
- Explain serverless databases.
- Query vs Scan.
- What is DAX?
- What are Global Tables?
- Explain TTL.
- Explain PITR.
- Difference between Partition Key and Sort Key.
- When should DynamoDB be used?
- What causes hot partitions?
Always answer with production use cases and discuss the trade-offs between scalability, consistency, and cost.
Summary
Amazon DynamoDB is a fully managed, serverless NoSQL database designed for applications requiring massive scalability, low latency, and high availability. Features such as automatic scaling, Global Tables, DAX, Point-in-Time Recovery, and built-in encryption make it an excellent choice for cloud-native applications.
Understanding DynamoDB fundamentals—including tables, items, attributes, primary keys, CRUD operations, Query vs Scan, TTL, Global Tables, DAX, and backups—provides the foundation for advanced topics such as partition key design, indexing, transactions, streams, and performance optimization covered in the following chapters.