All posts
Data Platform

When Postgres Outperforms DynamoDB: Five Situations, With Measurements

By

November 4, 2026

6 min read

DynamoDB is excellent at the questions you designed it for. Postgres wins when the questions change: ad-hoc reports, joins, aggregates, filters on any column, and access patterns discovered after launch. Our benchmark: an unplanned query at 5 million orders took 1.2 s in Postgres and 50 ms after a 2-second index build; in DynamoDB it was a full Scan or a new index backfilled across every item.

DynamoDB
Postgres
Architecture Decisions
Benchmark
100,000 orders2.0 ms0.62 ms10 ms1 million orders56 ms2.3 ms73 ms5 million orders1.2 s50 ms2.0 s

No index for it

With a partial index

Time to build the index

An unplanned question (large refunds in the last 30 days) in Postgres, before and after adding a partial index. Postgres 17, Apple M4, medians. Our benchmark, November 2026.

The data
No index for itWith a partial indexTime to build the index
100,000 orders2.0 ms0.62 ms10 ms
1 million orders56 ms2.3 ms73 ms
5 million orders1.2 s50 ms2.0 s

Five situations where Postgres wins

Situation

Postgres

DynamoDB

A report nobody planned for

Write the SQL; add an index in seconds if it becomes regular

Scan the table, or add a secondary index, which backfills and then charges a write on every future change

Data that is naturally relational (orders, customers, products, invoices)

Joins in one query

Duplicate data across items, or several requests stitched together in code

Aggregates (totals, counts, top 10)

GROUP BY

Scan and sum in code, or keep running totals with Streams and Lambda

Filters on any combination of columns

Composite and partial indexes, chosen later

Only key conditions are efficient; filters are applied after reading

Correctness rules across rows

Foreign keys, unique constraints, transactions over any rows

Condition expressions per item; transactions up to 100 items

Where DynamoDB still wins

  • Very high, spiky request rates on known keys, where it scales without anyone resizing anything.

  • Idle and small workloads: no instance to pay for when nothing happens. The free tier is 25 GB and 25 read and write units.

  • Very large tables with key-based access, where latency stays flat at billions of items.

  • Session state, carts, device state, idempotency keys, rate limits: one item per key, read and written by key.

Stuck with relational data in DynamoDB?

We move teams from DynamoDB to Postgres, or redesign the DynamoDB model, depending on which one the data actually wants. Free first call.

hoolco Monthly Review

Once a month: what changed in tech that month and what it means for you, from cloud and AI to security and the tools you build with. Every item links to its source. No sales pitch, unsubscribe in one click.

As of November 4, 2026. Provided as is, for general information, and accurate to the best of our knowledge on the date shown. Not legal, compliance, tax, financial or other professional advice. Prices, limits and vendor services change; check current vendor documentation before relying on anything here. Terms of use.