Does DynamoDB support foreign keys?

No. DynamoDB has no foreign keys, referential-integrity constraints, or cascading deletes — as a NoSQL database it never enforces relationships between items or tables. You model relationships yourself instead: denormalize related data into one item, or co-locate related items under a shared partition key with single-table design.

Why there are no foreign keys

A foreign key exists to support joins and enforce integrity across normalized tables. DynamoDB deliberately omits the JOIN operator (AWS recommends denormalizing instead), so a foreign-key constraint would police a relationship the query model never exploits. Nothing stops you storing another item's key as an attribute — DynamoDB just won't validate or cascade it. If enforced referential integrity is non-negotiable, DynamoDB vs PostgreSQL draws the line between the two models.

How relationships are modeled instead

  • Embed — small, bounded child data lives inside the parent item as a list or map.
  • Co-locate — parent and children share a partition key with distinct sort keys, so one Query returns the whole relationship; this is the heart of single-table design.
  • Duplicate — copy the fields each access pattern needs onto the items that need them, accepting write-time upkeep for single-request reads.

The one-to-many and many-to-many guides cover each shape in depth.

Enforcing integrity when it matters

For the cases where you'd have leaned on a constraint, DynamoDB gives you building blocks: condition expressions guard a write on the state of the item being written, and a transaction's ConditionCheck can verify a different item (say, the parent) exists in the same all-or-nothing operation. Cascading deletes become explicit application logic or a Streams-driven cleanup.

Go deeper

Start with single-table design, build the guarding conditions in the expression builder, and download DynoTable to see your item collections — parents and children side by side — in one view.

References

Last verified 2026-07-13 against the official AWS documentation linked above.

Work with DynamoDB without the Console

DynoTable is a fast desktop client for DynamoDB — browse tables, run SQL-style queries, and edit items locally.