Architecture decisions · Architecture and technical rescue
Do we need a search engine or a vector database next to our database?
Search needs to be better, and the proposal is a search engine or a vector database beside the database the team already runs.
01
How it is diagnosed
Write down what must stay consistent between what is stored and what is found; then run labelled queries on your own data against the database's own search and against the engine.
02
The options, side by side
03
What decides between the options
The size of the corpus and its growth, ranking or facet needs the database cannot meet, how soon a write must be searchable, and who will run the second system.
| What decides | A Search inside the database you already run: full-text, and pgvector for meaning-based search | B A search engine or a vector database beside it (OpenSearch, Elasticsearch, or a dedicated vector store) | C A hosted search service |
|---|---|---|---|
| Searchable right after a write What was stored and what is found should not disagree. | suits it In the same transaction. | needs work After the index's next refresh: a median of 713 ms in the lab. | needs work After the sync. |
| Systems to run For a small team, every extra system is a standing cost. | suits it One. | limited Two, and the sync. | needs work One more contract, and the sync. |
| Relevance and speed, at this size It is the usual reason to add an engine. | suits it Level with the engine at the lab's scale; test at yours. | suits it Level, once tuned; more headroom to grow. | suits it Depends on the service; headroom to grow. |
| Access rules A copied rule drifts from the original. | suits it Written once, in the query. | limited Copied into the engine. | limited Copied into the service. |
| Facets, relevance tuning and search analytics When search is the product, these features decide more than speed does. | limited Limited to what the database offers. | suits it This is what it is built for. | suits it Included, within what the service offers. |
Searchable right after a write A B C
What was stored and what is found should not disagree.
- A · Search inside the database you already run: full-text, and pgvector for meaning-based search suits it In the same transaction.
- B · A search engine or a vector database beside it (OpenSearch, Elasticsearch, or a dedicated vector store) needs work After the index's next refresh: a median of 713 ms in the lab.
- C · A hosted search service needs work After the sync.
Systems to run A B C
For a small team, every extra system is a standing cost.
- A · Search inside the database you already run: full-text, and pgvector for meaning-based search suits it One.
- B · A search engine or a vector database beside it (OpenSearch, Elasticsearch, or a dedicated vector store) limited Two, and the sync.
- C · A hosted search service needs work One more contract, and the sync.
Relevance and speed, at this size A B C
It is the usual reason to add an engine.
- A · Search inside the database you already run: full-text, and pgvector for meaning-based search suits it Level with the engine at the lab's scale; test at yours.
- B · A search engine or a vector database beside it (OpenSearch, Elasticsearch, or a dedicated vector store) suits it Level, once tuned; more headroom to grow.
- C · A hosted search service suits it Depends on the service; headroom to grow.
Access rules A B C
A copied rule drifts from the original.
- A · Search inside the database you already run: full-text, and pgvector for meaning-based search suits it Written once, in the query.
- B · A search engine or a vector database beside it (OpenSearch, Elasticsearch, or a dedicated vector store) limited Copied into the engine.
- C · A hosted search service limited Copied into the service.
Facets, relevance tuning and search analytics A B C
When search is the product, these features decide more than speed does.
- A · Search inside the database you already run: full-text, and pgvector for meaning-based search limited Limited to what the database offers.
- B · A search engine or a vector database beside it (OpenSearch, Elasticsearch, or a dedicated vector store) suits it This is what it is built for.
- C · A hosted search service suits it Included, within what the service offers.
04
What the work looks like
The step of the offer where a case like this usually starts:
03
Architecture assessment
Findings, risks, options and next steps, in writing. A good starting point when the scope is not yet clear.
05
Is this your case?
Send it with this problem already selected; the next page asks which options you considered and a little context. No verdict on your system: that only comes once I understand it.
Or write to me directly at contacto@danielcolaco.pt.