Quick revision
The short answer
I would make PostgreSQL the default for documents, text search and vectors, because consolidation removes systems, sync pipelines and skills we would otherwise pay for, and its extensions cover most needs well. But I would publish explicit criteria for when a team may adopt a specialised store, review exceptions, isolate heavy workloads even within PostgreSQL, and revisit the decision every year using the measured cost of each data system.
What to remember
In this answer, we saw that consolidating on PostgreSQL removes systems, sync pipelines and skills, and that jsonb, tsvector, pg_trgm and pgvector cover many needs with transactional consistency. Specialised systems still win at extreme scale or with advanced search and vector features, so the strategy is a strong default with published criteria and reviewed exceptions. One database doing everything brings resource isolation and upgrade problems, which we handle by consolidating on the engine rather than one instance, and we revisit the whole strategy yearly using the total cost of ownership of each data system.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would make PostgreSQL the default for documents, text search and vectors, because consolidation removes systems, sync pipelines and skills we would otherwise pay for, and its extensions cover most needs well. But I would publish explicit criteria for when a team may adopt a specialised store, review exceptions, isolate heavy workloads even within PostgreSQL, and revisit the decision every year using the measured cost of each data system.
Why this question is asked
The claim that one PostgreSQL can replace a document store, a search engine and a vector database is attractive to every engineering leader who pays for five data systems and the people to run them. It is also half true, which makes it dangerous both to accept and to reject. Interviewers ask this leadership question to see whether we can turn a fashionable claim into a strategy with defaults, limits and a way to change our minds. In this answer, we will look at what consolidation actually buys, where specialised systems still win, how to write criteria for exceptions, which operational limits appear when one database does everything, and how to keep the strategy honest over time.
1What Consolidation Actually Buys
Every extra data system has a cost that is easy to underestimate. Someone has to run it, upgrade it, secure it and be on call for it. Data has to be copied into it, usually with a sync pipeline that can lag or break, and every copy is a place where data can be inconsistent or leak. Teams need skills in it. If we can serve a need from the database we already run, we avoid all of that.
PostgreSQL now covers a lot of ground. jsonb with GIN indexes handles flexible documents. tsvector columns with GIN indexes give stemmed, ranked full-text search, and pg_trgm, the trigram extension, adds fuzzy and substring matching. pgvector stores embeddings, the lists of numbers that machine learning models produce to represent meaning, and indexes them with HNSW or IVFFlat for approximate nearest-neighbour search. A big advantage is transactional consistency: the product row, its search vector and its embedding change in the same transaction, so search never shows a product that was deleted a second ago.
Notice that this setup has no pipeline at all. For a catalogue of a few million products and a modest query rate, it is often all a company needs, and it is far cheaper than three clusters.
2Where Specialised Systems Still Win
The other half of the truth is that specialised systems were built for the extremes. A search engine such as Elasticsearch or OpenSearch offers analyzers per language, synonyms, typo tolerance, facets and relevance tuning that PostgreSQL text search does not try to match. A dedicated vector database is designed for hundreds of millions or billions of vectors, with filtering, sharding and memory management built for that scale, while an HNSW index in pgvector must fit comfortably in memory on one node to be fast. A wide-column or document store built for very high write throughput across many nodes handles loads that a single PostgreSQL primary cannot.
So the honest framing is not one database versus many. It is a default, plus a clear line beyond which the default stops being the cheaper choice.
3Writing the Criteria for Exceptions
A default only works if teams know when they may leave it. I would publish criteria in numbers and features, and send exceptions through a short review by the data platform group. Example thresholds, to be tuned to our hardware and measurements: more than about 50 million vectors or a recall and latency target pgvector cannot meet in a benchmark on our data; search features such as synonyms, per-language analysis or learning-to-rank that the product truly needs; or a write rate beyond what one primary can sustain with headroom.
- Start with PostgreSQLjsonb, tsvector, pg_trgm, pgvector
- Does a benchmark on our data meet the targets?YesUse PostgreSQL, isolate if heavyNoCheck the published criteria
- Does a criterion apply?scale, features, write rateYesRequest a reviewed exceptionNoTune or redesign in PostgreSQL
- Exception approvedowner, sync pipeline, on call named
4 steps in order. Play them, or step through them one at a time.
The review asks the team to show a prototype on real data, name who will operate the new system, and describe the sync pipeline and how they will handle its lag. That keeps the default strong without turning it into a ban, and it records the reasons, so the next team with the same need does not start the argument again.
4The Operational Limits of One Database Doing Everything
Consolidation has its own costs, and a strategy must plan for them. Resource isolation is the biggest: an HNSW index build can use gigabytes of maintenance memory and hours of CPU, and a heavy search query competes with checkout for the same buffer cache. Upgrades get harder too, because a major version upgrade must now be compatible with every extension, and the riskiest workload sets the pace for all the others. Backups and restores grow with every new use.
The answer is to consolidate on the engine, not on one instance. Search and vectors can live on a separate PostgreSQL cluster, or on a replica with its own indexes, run by the same team with the same tools and skills. We keep most of the savings, one technology, one set of runbooks, while a runaway vector build cannot slow payments.
- Checkout and orders clusterOLTP only, strict latency targets
- Search and vector clustertsvector, pg_trgm, pgvector, fed from OLTP
- Shared platform toolingone backup, monitoring and upgrade process
- Reviewed exceptionssearch engine or vector store when criteria apply
4 layers, from the top down. Step through them one at a time.
5Keeping the Strategy Honest Over Time
Engines change fast. pgvector has gained new index types and better filtering over a few releases, and search engines keep adding vector features of their own. So I would put the strategy on a yearly review, and base it on numbers rather than opinions: total cost of ownership per data system, which includes licences or cloud bills, the engineering hours to run it, incidents, and the cost of its sync pipelines. If an exception keeps growing, that is a signal to make it a supported second default. If a specialised system serves a need PostgreSQL now covers, that is a candidate to retire.
6Follow-up questions
How would you convince a team that already uses Elasticsearch to move?
I would not force it. Existing systems that meet their needs stay until a natural trigger, such as a large upgrade or a cost review. For new needs the default applies, and if the team shows the criteria are met, they get an exception like anyone else.
What is the biggest risk of the consolidation strategy?
The noisy neighbour: one heavy workload hurting the critical one in the same instance. Separate clusters for analytical, search and vector loads, statement timeouts and per-role limits manage that risk.
How do you measure total cost of ownership fairly?
Count the bill, the people time spent on operations and upgrades, incidents and their impact, and the sync pipelines each system needs. Measure it the same way for every system every year, so the trend matters more than the exact figure.
7Conclusion
In this answer, we saw that consolidating on PostgreSQL removes systems, sync pipelines and skills, and that jsonb, tsvector, pg_trgm and pgvector cover many needs with transactional consistency. Specialised systems still win at extreme scale or with advanced search and vector features, so the strategy is a strong default with published criteria and reviewed exceptions. One database doing everything brings resource isolation and upgrade problems, which we handle by consolidating on the engine rather than one instance, and we revisit the whole strategy yearly using the total cost of ownership of each data system.
Open with
I would treat the claim as a useful default, not a law. Consolidation is real value: every extra data system brings operations, upgrades, on call, a sync pipeline that can lag, and skills we have to hire for.
Then, if they want more
PostgreSQL with jsonb, tsvector full-text search, pg_trgm for fuzzy matching and pgvector for embeddings covers most of our needs, and it keeps the data consistent in one transaction.
But specialised systems still win at the extremes: a search engine for synonyms, per-language analysis and relevance tuning, a vector database for hundreds of millions of vectors, and distributed stores for very high write rates. So my strategy has four parts. First, PostgreSQL is the default.
Second, I publish explicit criteria, in numbers and features, for when a team may adopt something else, and exceptions go through a short review with a prototype on real data and a named owner.
Third, I plan for the limits of one database: heavy search or vector workloads go to a separate PostgreSQL cluster or replica so they cannot slow checkout, and upgrades are planned around extension compatibility.
Fourth, I review the strategy yearly using total cost of ownership per data system, including people time and incidents, so we retire systems that are no longer needed and promote exceptions that keep growing.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, The SQL Language
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Relational databases have added JSON, full-text search and vector search, and some argue...": https://scrivio-interview-library.netlify.app/databases/advanced-sql/aba6f24c53/