← All guides
fundamentalsarchitecture

What is Polyglot Persistence and Why Should You Care?

Most production apps use more than one database. Here's what that means, why it happens, and how to think about it.

7 min read · 25 April 2026

Every developer learns databases the same way. You pick one — usually PostgreSQL or MongoDB — and you use it for everything. Users, posts, sessions, logs, search results. One database, one connection string, one mental model.

This works fine for a while. Then your app grows, and cracks start to appear.

Your Postgres query for full-text search is slow. Your session lookups are hammering the database on every request. Your recommendation engine needs to find similar items but SQL wasn’t built for that. You add indexes, optimise queries, throw more hardware at it — but the fundamental problem remains.

You’re using the wrong tool for the job. Or rather, you’re using one tool for every job.

What is polyglot persistence?

Polyglot persistence is the practice of using multiple different types of databases within a single application — choosing the right database for each specific use case rather than forcing all data into one system.

The word “polyglot” comes from linguistics — it means speaking many languages. A polyglot application speaks many database languages.

Instead of asking “which database should I use?”, you ask “which database is best for this specific problem?”

This isn’t a new idea. Martin Fowler and Pramod Sadalage coined the term in 2011. What’s changed is that it’s now standard practice — and with serverless databases like Supabase, Upstash, and Neon, it’s cheaper and easier than ever to run multiple databases in a single app.

Why does it matter?

Every database type was built to solve a specific class of problem exceptionally well. When you force one database to do everything, you get mediocre performance across the board instead of excellent performance where it counts.

Here’s what a real production app might look like:

Use caseBest database typeWhy
User accounts, ordersPostgreSQLACID transactions, foreign keys
Sessions, rate limitingRedisSub-millisecond reads, TTL support
Product searchElasticsearchFull-text search, fuzzy matching
AI recommendationspgvectorVector similarity search
Activity logsMongoDBFlexible schema, high write volume

Each of these databases is world-class at its specific job. None of them is world-class at all five jobs.

A concrete example

Imagine you’re building an e-commerce app. You start with just PostgreSQL — users, products, orders, all in one place. Life is simple.

Then you add search. PostgreSQL’s LIKE queries work at first, but users complain it doesn’t handle typos. You try pg_trgm — better, but still slow on a large catalogue. You add Elasticsearch. Now search is fast, typo-tolerant, and returns ranked results. That’s polyglot persistence.

You notice your API is slow because every page load checks the session, fetches the user, and loads their cart from PostgreSQL. You add Redis. Sessions live in memory now — sub-millisecond lookups, automatic expiry. That’s polyglot persistence.

You build a “you might also like” feature. Postgres can’t do similarity search efficiently. You enable pgvector and store product embeddings. Now recommendations are fast and semantically meaningful. That’s polyglot persistence.

None of these decisions were complicated. Each one solved a specific problem with the right tool.

The concern most developers have

“This sounds like a lot of complexity. Do I really need multiple databases?”

Honest answer: not at first. For a small app or an early-stage product, PostgreSQL alone will take you further than you think. Don’t add complexity before you need it.

But the moment one of these things becomes true, it’s time to think polyglot:

  • Your search queries are slow and users notice
  • Your session lookups are causing database load spikes
  • You need similarity search or vector embeddings
  • You have high-volume write workloads (logs, events, analytics)
  • Your data doesn’t fit neatly into rows and columns

What makes it hard today

The actual databases are excellent. Redis, Elasticsearch, and PostgreSQL all have world-class documentation.

What doesn’t exist — until now — is guidance on combining them. How do you keep Redis in sync with Postgres? How do you set up Elasticsearch to mirror your product catalogue? How do you choose which combination is right for your use case?

That’s exactly what polyglotstack.dev is here to answer.

What’s next

In the next guide we’ll look at the most common first step into polyglot persistence: adding Redis to an existing PostgreSQL application. We’ll cover exactly when it makes sense, how to set it up, and the cache-aside pattern that 90% of production apps use.

Until then — if you have a specific database combination you’re trying to figure out, join the Discord and ask. Every question shapes what we write next.