Guide · 8 posts

Postgres is enough (most of the time)

Most apps add Redis for queues, Elasticsearch for search, MongoDB for documents and a vector database for AI, then spend their time keeping five systems in sync. I tested whether PostgreSQL can do each of those jobs well enough to skip the extra system.

The short answer: for most products, yes, up to a point. The table shows where Postgres held its own and where the dedicated tool still wins.

The results

Postgres against the dedicated tools

JobIn PostgresCompared withWhat I measuredMy pick
Full-text searchBM25 extension (pg_textsearch or pg_search)Elasticsearch 9.5.5, MeilisearchRanking within about 0.05 nDCG@10 of Elasticsearch on three BEIR datasets; new rows searchable in 2–4 ms vs about 706 ms.Postgres, with a BM25 extension
Job queuepg-boss, SKIP LOCKED tableBullMQ on RedisNo Redis needed up to a few thousand jobs per second; BullMQ on Redis had the most throughput.Postgres, until you need maximum throughput
Pub/subLISTEN/NOTIFYRedis pub/subBoth had sub-millisecond median latency; Redis had steadier p99 at higher rates. NOTIFY is transactional, so a rolled-back write sends nothing.Postgres for app events, Redis for high fan-out
JSON documentsJSONB with B-tree expression indexesMongoDB 9.0JSONB over 2x faster for indexed reads; MongoDB loaded 3.8x faster and used 5.6x less disk.Postgres for relational data with flexible fields
Vector searchpgvector (HNSW)Qdrant 1.19, Pineconepgvector reached 0.988 recall@10 at 4.0 ms on 100,000 embeddings; Qdrant was about 1.5x faster at equal recall.Postgres to start, Qdrant at scale or with heavy filters
Primary keysuuidv7() on PostgreSQL 18UUIDv4, bigintUUIDv7 loaded 10M rows as fast as bigint (37.3 s); UUIDv4 took 84.2 s and wrote 2.2x more WAL.UUIDv7 when you want UUIDs

Each row links to the full post with the setup, versions and code.

Step 1

Replace the extra systems

Start with the job you're about to add a new database for.

Step 2

Model the data

Choices that are hard to change once you have millions of rows.

Step 3

Run it

Keep the single database healthy.

Need a backend designed around Postgres?

I build this for clients. Send the problem and a rough timeline.