DynamoDB interview question · Most asked

What is single-table design, and what are its pros and cons?

Summary

Single-table design stores several entity types in one table with generic key attributes (PK, SK, GSI1PK, ...) so related items live in the same item collection and can be fetched together in one Query, effectively pre-joining data.

Longer Answer

Pros: fewer round trips (fetch a customer and their recent orders in one request), fewer tables to provision and monitor, and overloaded GSIs serving several patterns.

Cons: a steeper learning curve, harder ad-hoc inspection and analytics, schema changes and new patterns are harder, and per-entity settings (streams, TTL, backups, capacity) apply to everything in the table.

It is a tool, not a rule. Many teams use one table per bounded context or service, and separate tables when entities have different access, scaling or lifecycle needs. Use single-table design where fetching related entities together really matters.

Key Points

  • Several entity types, generic key names.
  • Related items in one item collection.
  • Fewer round trips; harder analytics and evolution.
  • Use where it pays off, not by default.

More most-asked DynamoDB questions

← All DynamoDB questions