Prompt
I'm building product search with keyword plus vector matching, what database should I choose?
Latest observation
If you want keyword search + vector similarity search in one system, the best database depends on your scale and how much search quality you need.
Good default choice
PostgreSQL + pgvector
Choose this if:
- you’re building an MVP or early product
- your catalog is small to medium
- you want the simplest stack
- you already use Postgres
Pros
- single database for relational data, keyword search, and vectors
- easy to operate compared with a separate search engine
- supports hybrid ranking via SQL
- great for filters like brand, price, category, availability
Cons
- keyword search is decent, but not as advanced as dedicated search engines
- vector performance is good, but not the best at very large scale
Best for
- tens of thousands to a few million products
- search with strong filtering and decent hybrid relevance
Best search-first choice
Elasticsearch / OpenSearch
Choose this if:
- search relevance is a core product feature
- you need advanced keyword search, faceting, autocomplete, typo tolerance
- you want mature hybrid search support
Pros
- excellent keyword search
- great filtering, faceting, analyzers, synonyms
- can combine lexical and vector search
- built for search at scale
Cons
- more operational overhead
- more moving parts than Postgres
- vector search is improving, but hybrid relevance tuning can take work
Best for
- large catalogs
- e-commerce search where quality matters a lot
- teams comfortable with search infrastructure
Best fully managed vector + keyword option
MongoDB Atlas Search / Atlas Vector Search
Choose this if:
- you already use MongoDB
- you want managed search without running separate infra
- your product data is document-shaped
Pros
- integrated search and vector capabilities
- easy managed experience
- good for product documents
Cons
- less flexible than a dedicated search engine in some cases
- may not be ideal if SQL/relational queries are important
Other options
Pinecone / Weaviate / Qdrant
These are great if you mainly want vector search, but for keyword + vector product search, they usually need to be paired with another system for lexical search and structured filtering.
- Qdrant: strong vector DB, good filtering, open source
- Weaviate: hybrid search friendly, good developer experience
- Pinecone: managed vector search, easiest ops, but keyword search is not the main strength
These are best when semantic search is central and keyword search is secondary.
Practical recommendation
Pick based on your stage:
- MVP / small-medium catalog → PostgreSQL + pgvector
- Serious search relevance / large catalog → Elasticsearch or OpenSearch
- Already on MongoDB → MongoDB Atlas Search
- Mostly semantic search → Qdrant / Weaviate / Pinecone
My default suggestion
If you’re unsure, start with:
PostgreSQL + pgvector
- store product metadata in Postgres
- use full-text search for keywords
- use pgvector for embeddings
- combine both in a hybrid ranking query
This is usually the fastest path to a working product search system.
If the search experience becomes a core differentiator later, you can move to OpenSearch/Elasticsearch.
If you want, I can also give you:
- a decision matrix,
- an architecture diagram, or
- a sample hybrid search query for Postgres/OpenSearch.