Karthik's Blog
← Back to Blog

Replace entire stack with Postgres!

2026-04-18

The other day I was watching the youtube video titled "I replaced my entire stack with Postgres..." by the YouTube channel The Coding Gopher.

It argues that modern software engineering has become overengineered, often forcing developers to manage a "fragile distributed web" of specialized microservices—like Redis for caching, Kafka for jobs, and Pinecone for AI—which leads to high costs and complexity.

The central thesis is that PostgreSQL, a battle-tested, 30-year-old open-source database, can "cannibalize" almost your entire architecture because of its massive ecosystem of extensions and architectural flexibility.

How Postgres Replaces Other Tools

The source details several specific technologies that can be replaced by native Postgres features or extensions:

  • NoSQL Databases (e.g., MongoDB): Using the JSONB data type and GIN (generalized inverted) indexes, Postgres can handle unstructured data with the flexibility of NoSQL without sacrificing ACID compliance or data integrity.

  • Message Queues (e.g., Redis, RabbitMQ): By using the FOR UPDATE SKIP LOCKED clause, developers can turn a standard relational table into a highly concurrent, wait-free message queue for background jobs.

  • Search Engines (e.g., ElasticSearch): Postgres provides advanced full-text search through TS_VECTOR and TS_QUERY, along with the pg_trgm extension for fuzzy matching to handle typos.

  • Vector Databases (e.g., Pinecone): The PG_VECTOR extension allows for storing high-dimensional arrays and performing fast similarity searches using HNSW (hierarchical navigable small world) indexes directly alongside relational data.

  • GIS & Time Series Systems: The source highlights PostGIS for geographic data and the use of declarative partitioning combined with BRIN (block range) indexes to handle massive volumes of telemetry and event logs.

  • Data Warehouses & Middleware: Materialized views can replace expensive data warehouses for dashboards.

Furthermore, tools like PostgREST or PG_GRAPHQL, combined with Row-Level Security (RLS), can eliminate the need for a fleet of API servers (like Node.js or Python middleware) by exposing the database directly as a secure API.

Limitations

The author notes that Postgres is not a "silver bullet." While it scales vertically very well, horizontal sharding is complex.

If an application requires sub-millisecond caching for millions of concurrent users or needs to ingest millions of events per second, specialized distributed tools are still necessary.

We conclude that until a project reaches "massive enterprise scale" using Postgres as a single source of truth is the smartest and most cost-effective engineering decision.