Postgres is not a database.


Postgres is not a database.

For years, we’ve been taught to see Postgres as the reliable, open source workhorse for storing our data.
Everyone called it "The Toyota of databases", you know... it just works.
But to leave it at that is to miss the whole story.
Postgres isn’t just a place to put your data, it’s a powerful development platform that can become the core of your entire backend, an operating system (yea, bold) for your application’s stack.

Diving deep into its capabilities I learned that Postgres was built with extensibility at its heart.
This means that with a few commands, you can bolt on new powers that allow it to replace dedicated, single purpose tools you’re likely paying for and maintaining right now.
Think of your cache (redis), your message broker (rabbit / kafka), your search engine (elastic), and even your job scheduler.
Postgres can do all of that, and often, it can do it without adding a single new server to your stack.

The most practical way to put this into action is to change your mindset.
The next time you think, “I need a message queue for this feature,” your first question shouldn’t be, “Should we use RabbitMQ or SQS?” but rather “Can Postgres handle this?”
More often than not, the answer is yes.
Now, let's hit the breaks for a second.
No, I'm not claiming Postgres does all of these better.
I'm saying it does it, well enough, to go a long, long way, until you actually need something else.
By starting small and replacing one piece of your stack at a time, you can drastically simplify your architecture, reduce operational overhead, and move faster.

So, what’s the big problem we’re all facing?
Modern application development has led to backend sprawl.
It's FOMO-driven development.
To build a feature rich application, you’re told you need a whole suite of specialized tools.
Your shopping cart looks something like this: a primary database (Postgres), a caching layer (Redis), a message queue for background jobs (RabbitMQ), a real-time notification system (maybe also Redis pub/sub), and a powerful search engine (Elasticsearch).
And this is without even mentioning your cloud platform and the plethora of services they offer for these tools, either directly managed, or a competition of some sort.
Your architecture diagram starts to look like a complex web of interconnected services.

The default solution for most developers is to spin up a new service for each new problem. It’s the “best tool for the job” philosophy.

But it can be different.

This is where we can solve the problem differently by leaning into the full power of Postgres.
Instead of building outwards, we build inwards, consolidating our stack directly within the database we already trust, as much as possible.

  • Replacing your Cache (like Redis): Postgres has UNLOGGED tables.
    These tables don’t write to the standard transaction log (WAL), making them incredibly fast for temporary data, perfect for a cache.
    Pair this with the pg_cron extension to run a simple cleanup procedure every hour, and you’ve just built a TTL cache inside Postgres, no Redis required.
  • Replacing your Pub/Sub and Message Queue (like RabbitMQ or SQS): For simple, real-time notifications, Postgres has built in LISTEN and NOTIFY commands. For more robust, persistent queuing, the pgmq extension gives you a lightweight message queue with an API that’s compatible with AWS SQS, making it incredibly powerful for background jobs.
  • Replacing your Document Database (like MongoDB): Do you need to store unstructured data? The native JSONB data type is a game-changer. It stores your JSON as a decomposed binary format that is fully indexed and queryable.
    You can query nested fields, check for the existence of keys, and get the flexibility of a NoSQL database without adding another system.
  • Replacing Specialized Data Stores: The ecosystem of extensions is where Postgres truly shines and becomes a platform:
    • Geospatial Data: The PostGIS extension turns your database into a full-featured geospatial server, allowing you to store coordinates and run complex location-based queries, like finding the closest coffee shop.
    • Vector Search for AI: With the rise of AI, everyone needs a vector database. The pgvector extension lets you store and query embeddings right next to your application data.
    • Time-Series Data (like Elasticsearch): Extensions like TimescaleDB transform Postgres into a high-performance time-series database, perfect for analytics, IoT, and monitoring workloads.

By leveraging these features and extensions, you can shrink your backend from five or six disparate services into one robust, reliable, and battle-tested platform: Postgres.

I hope this was valuable!

Feel free to reply directly with any question or feedback.
Thank you for reading.

Have a great weekend!

ESPRESSO FRIDAYS

Every once in a while I send hand picked things I've learned. Kind of like your filter to the tech internet. No spam, I promise!

Read more from ESPRESSO FRIDAYS

Wait... NGINX can do WHAT?! This issue is brought to you by: Reliable DNS hosting & domain name managementWith DNSimple! From a streamlined interface to single-click integrations, DNSimple delivers the tools you need to simplify your day. Developers and system admins love our single-click integrations and automation tools for domains, DNS, and more. Enterprise teams simplify management of the most complex domain environments through our NEW Domain Control Plane. Try FREE for 30 days! Most...

Redis is Not What You Think It Is. This issue is brought to you by: Securing Vibe Coding: Addressing the Security Challenges of AI-Generated Code As AI coding tools become embedded in daily development, they bring a new wave of productivity, and new security risks. On November 20 @ 11AM EST, Snyk Staff Developer Advocate Sonya Moisset will break down the security implications of vibe coding and share actionable strategies to secure AI-generated code at scale. Attendees can earn 1 CPE credit...

Give me 10 minutes and I'll make you a REGEX expert. This issue is brought to you by: Warp is a fully fledged Agentic Development Environment. From prompt → production “The IDE is dead. The ADE is in”.Coding tasks start with a prompt in Warp, not a heavyweight IDE that takes up 3/4 of your screen with code. Warp is free to try but for a limited time, try Warp Pro free for 7 days with 2,500 Al credits-no card required. Click here to start (It’s Free!) Regex has been around for years -...