DynamoDB interview question · Most asked
What is DynamoDB, and what workloads is it a good fit for?
Summary
DynamoDB is AWS's fully managed, serverless key-value and document database. It delivers consistent single-digit-millisecond latency at almost any scale, with no servers, patching or capacity planning in on-demand mode. It fits workloads with known, key-based access patterns and very high or spiky traffic.
Longer Answer
Good fits: user profiles and sessions, shopping carts, order and event data accessed by ID, IoT and time-series ingestion, gaming state, serverless backends with Lambda, and anything needing predictable latency at large scale.
Poor fits: ad-hoc queries and analytics, many-to-many relational reporting, full-text search, and workloads where access patterns are unknown or change often. Those need SQL, a search engine, or exporting DynamoDB data to S3 for analytics.
The core trade-off: DynamoDB scales by forcing you to design tables around how you read and write data, instead of normalising and querying flexibly.
Key Points
- Managed, serverless key-value/document store.
- Predictable low latency at scale.
- Design for known access patterns.
- Not for ad-hoc queries or analytics.
Explanation
What interviewers look for
A balanced view of when DynamoDB is right, not just that it scales.
More most-asked DynamoDB questions
- Explain partition keys, sort keys and the two kinds of primary key.
- How do conditional writes work, and how do you implement optimistic locking in DynamoDB?
- What is a hot partition, and how do you avoid one?
- How do you approach data modelling in DynamoDB, and how is it different from relational design?
- What are DynamoDB Streams, and how are they used?
- Global secondary index or local secondary index: what is the difference?
- Query or Scan: what is the difference, and why avoid Scan?
- DynamoDB or a relational database such as Aurora PostgreSQL: how do you decide?