# Postgres as the default database: when it fits and when not

URL: https://brainpowergroup.eu/en/blog/postgres-as-the-default-database
Date: 2026-02-05 (updated 2026-08-12)
By: Aleksa, Brainpower Group

Pick PostgreSQL for a new product. With jsonb, full-text search and pgvector you rarely need a second database early on, which saves operations work and money.

If you are starting a new product and have no strong reason to pick something else, pick PostgreSQL. It is a relational database with transactions and mature SQL, and it also handles JSON documents, full-text search and, through the pgvector extension, vectors for AI search features. That means you rarely need a second database early on, which saves operations work and therefore money.

## Why Postgres makes a good default

Postgres is open source and runs anywhere: on your laptop, in Docker, on your own servers and as a managed service from the major cloud providers, including their European regions. You are not tied to one vendor.

It is also the database most developers work with. In the 2025 Stack Overflow Developer Survey, PostgreSQL was the most used database, at 55.6 percent of all respondents against 40.5 percent for MySQL. That matters for hiring and onboarding.

The release cycle is predictable. A new major version comes out roughly once a year, and each version is supported for five years. You can plan upgrades well in advance.

## JSON without a separate document database

Postgres has two JSON types. `json` stores the text as is; `jsonb` stores a binary form that is faster to process and can be indexed. The documentation recommends `jsonb` for nearly all applications.

A GIN index on a `jsonb` column makes lookups on keys and values fast. My advice is to use `jsonb` for fields that differ per record, such as product attributes or per-customer settings. Fields you filter or join on often become regular columns. That keeps your queries readable and your indexes small.

## Full-text search is built in

Postgres provides the `tsvector` and `tsquery` types for this, with ready-made configurations for many languages. Add an index and that is enough for search inside an application: customers, orders, documents or help articles.

If you have a large product catalogue with facets, typo tolerance and a lot of ranking work, a dedicated search engine is often the better tool. For [ViaLuxury](/en/cases/vialuxury), for example, we set up the availability database on Elasticsearch.

## Vectors with pgvector

pgvector adds vector types and distance search to Postgres. You choose between two index types. HNSW gives a better trade-off between speed and recall, but builds more slowly and uses more memory. IVFFlat builds faster and uses less memory, but its query performance is lower, and you create it only after the table has data.

Keeping vectors in your main database means the embeddings sit next to the data they describe. In one query you filter on customer, permissions and date and search by meaning. You have one backup and one place to manage access. How to build features like that is covered in [adding AI features to existing software](/en/blog/adding-ai-features-to-existing-software).

## When Postgres is the wrong choice

| Situation | Better fit |
|---|---|
| Analytics over billions of rows, mostly reading and aggregating | A columnar database or a data warehouse |
| Cache, sessions and rate limiting with a very high rate of reads and writes | Redis or a similar key-value store |
| An organisation that runs entirely on SQL Server, with DBAs and reporting | SQL Server, unless there is a reason to migrate |
| An app that runs locally or on a device without a server | SQLite |
| Faceted, typo-tolerant search across a large catalogue | A search engine such as Elasticsearch or OpenSearch |

In most of these cases the second database sits next to Postgres as an addition. Your core data stays where it is.

## What to set up in operations

A managed database costs more per month than a server of your own, but backups, failover and updates are taken care of. For a small team that usually works out cheaper once you count the hours.

Postgres starts a separate server process for every connection. If you run many application instances or serverless functions, put a connection pooler such as PgBouncer in between.

Enable `pg_stat_statements` so you can see which queries take the most time. Review it every month, together with the growth of your largest tables and indexes.

Teach everyone on the team to read `EXPLAIN ANALYZE`. A slow page often comes down to a missing index or a query that fetches far more rows than it needs. The query plan shows that straight away, and a developer who can read it fixes the problem without waiting for a DBA.

Plan your major upgrades. PostgreSQL 14 receives no more updates after 12 November 2026. If you still run it, schedule the upgrade now. While you are at it, test your backups with a real restore. How to go about that is covered in [backups and disaster recovery](/en/blog/backups-and-disaster-recovery).

## Sources

- [PostgreSQL: Versioning Policy](https://www.postgresql.org/support/versioning/)
- [PostgreSQL docs: JSON Types](https://www.postgresql.org/docs/current/datatype-json.html)
- [PostgreSQL docs: Full Text Search, Introduction](https://www.postgresql.org/docs/current/textsearch-intro.html)
- [PostgreSQL docs: How Connections Are Established](https://www.postgresql.org/docs/current/connect-estab.html)
- [pgvector on GitHub](https://github.com/pgvector/pgvector)
- [Stack Overflow Developer Survey 2025: Technology](https://survey.stackoverflow.co/2025/technology)

## Frequently asked questions

**Why do so many teams choose PostgreSQL?**

Postgres is open source, runs everywhere and handles JSON, full-text search and, with pgvector, vectors next to relational data. It was the most used database in the 2025 Stack Overflow Developer Survey.

**Can you do vector search for AI features in Postgres?**

Yes, with the pgvector extension, which supports HNSW and IVFFlat indexes. Your embeddings then live in the same database as the data they describe, with the same backups and permissions.

**When do you need another database next to Postgres?**

For analytics over very large data volumes, for a cache with a very high rate of reads and writes, and for faceted search across a large catalogue. In most cases that database sits next to Postgres rather than replacing it.

---

Source: https://brainpowergroup.eu/en/blog/postgres-as-the-default-database
Brainpower Group, contact: https://brainpowergroup.eu/en/contact, hello@brainpowergroup.eu
