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
| Job | In Postgres | Compared with | What I measured | My pick |
|---|---|---|---|---|
| Full-text search | BM25 extension (pg_textsearch or pg_search) | Elasticsearch 9.5.5, Meilisearch | Ranking 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 queue | pg-boss, SKIP LOCKED table | BullMQ on Redis | No Redis needed up to a few thousand jobs per second; BullMQ on Redis had the most throughput. | Postgres, until you need maximum throughput |
| Pub/sub | LISTEN/NOTIFY | Redis pub/sub | Both 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 documents | JSONB with B-tree expression indexes | MongoDB 9.0 | JSONB 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 search | pgvector (HNSW) | Qdrant 1.19, Pinecone | pgvector 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 keys | uuidv7() on PostgreSQL 18 | UUIDv4, bigint | UUIDv7 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.
- Postgres Full-Text Search vs Elasticsearch vs Meilisearch: BM25 Benchmarked (2026)Search without Elasticsearch, and where tsvector falls short.10 min read
- Postgres Job Queues in 2026: SKIP LOCKED vs pg-boss vs BullMQ (Redis and Postgres), BenchmarkedBackground jobs without Redis, with the settings that matter.14 min read
- Postgres LISTEN/NOTIFY vs Redis Pub/Sub: Latency, Write Cost and Failure Cases, TestedReal-time events from the database you already have.6 min read
Step 2
Model the data
Choices that are hard to change once you have millions of rows.
- MongoDB vs Postgres JSONB in 2026: Inserts, Lookups, Updates and Storage, BenchmarkedWhen JSONB beats a document database, and when it doesn't.12 min read
- UUIDv7 in PostgreSQL 18: uuidv7() vs UUIDv4 vs bigint Primary Keys, BenchmarkedPrimary keys that don't fragment your indexes.8 min read
- pgvector vs Pinecone vs Qdrant: Benchmarked for RAG in 2026Embeddings next to your data for RAG.9 min read
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.