Home / Videos

Video

A practical guide for choosing a vector database

A detailed, vendor-neutral walkthrough of how to choose a vector database: when an extension such as pgvector is enough, the four families of options, sizing memory from vector count and dimensions, index types and quantization, filtering and hybrid search, multi-tenancy, operations, security and cost, then a decision flow and a proof-of-concept bake-off you can run before you commit.

Deepak Bhardwaj17:57

Captions are on by default; turn them off from the player menu. The narration uses a synthetic voice.

Transcript

A practical guide for choosing a vector database

Welcome to HubDat AI. In this video we work through a practical, vendor-neutral way to choose a vector database. We start with the question most teams skip: do you need a dedicated vector database at all? Then we look at the four families of options, size the memory you will need, compare index types, filtering, hybrid search and multi-tenancy, and check the operations side: high availability, backup, security and cost. We finish with a decision flow and a proof-of-concept bake-off you can run before you commit.

What we cover

Here is the plan. First, whether you need a dedicated product, and the four families to choose from. Then eight steps: size the data and memory, understand the query pattern, pick index types and quantization, check filters and hybrid search, plan multi-tenancy, review operations including high availability and disaster recovery, cover security and compliance, and build a cost model. After that, a decision flow, a comparison table, a bake-off method, the mistakes we see most often, and how to keep an exit plan.

Do you need a dedicated vector database?

Start with the question most teams skip. Do you need a new database at all? If you already run PostgreSQL and expect up to a few tens of millions of vectors, pgvector is usually the right first choice. Your data, transactions, backups and security model stay in one place. If your search already lives in Elasticsearch, OpenSearch or Azure AI Search, use their vector fields and get hybrid search for free. For a prototype, Chroma or pgvector on one virtual machine is enough. Move to a dedicated vector database when you need hundreds of millions of vectors, high query rates, heavy filtering at scale, or special indexes such as disk based or GPU indexes. Remember that every extra database is one more thing to patch, back up and secure.

Four families of options

The market looks crowded, but it falls into four families. First, an extension in a database you already run: pgvector for PostgreSQL, Redis, MongoDB Atlas, or the vector type in SQL Server and Azure SQL. No new platform, and you keep joins and transactions, but there is a scale ceiling and the vector work competes with your normal workload. Second, search engines with vector fields: Elasticsearch, OpenSearch and Azure AI Search. They are strong at hybrid keyword plus vector search, with mature operations. Third, purpose-built databases you host yourself: Milvus, Qdrant, Weaviate and Chroma. The most features and index choices, but you own high availability, upgrades and backup. Fourth, managed or serverless services such as Pinecone, Zilliz Cloud, Qdrant Cloud, Weaviate Cloud and Databricks Vector Search. Fast to start, but check data residency, unit pricing and lock-in.

Size the data: memory is the main driver

Step one is sizing, because memory drives both the product choice and the cost. The raw size is the number of vectors, times the dimensions, times four bytes for 32 bit floats. Ten million vectors of 1536 dimensions is about 61 gigabytes before any index. Half precision halves it to about 31. Int8 scalar quantization brings it to about 15, and binary quantization to under 2 gigabytes. On top of that, an H N S W graph adds roughly M times 8 bytes per vector, plus metadata and payload. Then multiply by the number of replicas and keep about 30 percent free memory. Size for 12 to 24 months of growth, not today. And remember that choosing an embedding model with fewer dimensions halves everything at once.

Understand the query pattern

Step two is the query pattern. Write down the peak queries per second and the P 95 and P 99 latency your application needs, because they decide replicas, index type and hardware. Set a recall target, for example recall at 10 of at least 0.95. Higher recall always costs latency or memory. Ask whether most queries carry metadata filters, such as tenant, language or date. If they do, you need filter-aware indexing, not filtering after the search. Ask whether users type exact terms like error codes or product names. If they do, you need hybrid keyword plus vector search. Finally, note the write rate, how fresh results must be, and how often data is updated or deleted, because some indexes degrade until compaction or vacuum runs.

Index types and quantization

Step three is the index. Flat, or exhaustive, search compares every vector and is exact. It is fine under about a hundred thousand vectors, and it is your ground truth for measuring recall. H N S W is a layered graph held in memory, and it is the default choice almost everywhere: high recall at low latency, at the cost of memory and slower builds. I V F groups vectors into clusters and only searches the nearest ones. It builds faster and uses less memory, but needs training data and tuning. Disk based indexes such as disk A N N keep the graph on fast SSD with a small memory cache, which makes billions of vectors affordable. GPU indexes give very high throughput and fast rebuilds. And quantization compresses vectors four to thirty-two times, usually with a rescoring step to recover recall. Check which of these each candidate actually supports.

Tuning knobs you will live with

Each index comes with tuning knobs you will live with for years. For H N S W, M sets the links per node and ef construction sets build quality, both fixed at build time, while ef search trades latency for recall at query time. For I V F, the number of lists is set at build and n probe at query time. Watch out: some products fix the distance metric, the dimensions, and sometimes even the search settings when the collection is created. Changing them means a full re-index. The distance metric must match what your embedding model was trained for, usually cosine or dot product. So during evaluation, ask each vendor one direct question: which settings can I change later without rebuilding?

Filtering and hybrid search

Step four is filtering and hybrid search, where many projects fail in production. With post-filtering, the engine finds the top results and then drops the ones that do not match the filter. It is fast, but a selective filter can leave you with too few results, or none. Pre-filtering applies the filter first, which is accurate, but can be slow when the filter matches most of the data. The best engines use filter-aware indexes, where payload or attribute indexes are used during the graph walk. Qdrant, Weaviate and Milvus do this, and pgvector 0.8 added iterative index scans. For hybrid search, keyword scoring with B M 25 is merged with vector scores using reciprocal rank fusion, R R F, or weights. Search engines and several vector databases do this natively. With pgvector you combine full-text search and R R F in SQL. Then add a reranker for the final few dozen results.

Multi-tenancy

Step five, if you serve several customers or business units, is multi-tenancy. The cheapest pattern is one shared collection with a tenant filter on every query: Qdrant has a tenant payload index, Milvus a partition key, and pgvector can use row-level security. Native tenants or namespaces, in Weaviate and Pinecone, scale to thousands of tenants and can offload idle ones to cheaper storage. A collection per tenant gives stronger isolation for a few large tenants, but most products limit how many collections you can have. A cluster per tenant is for regulated data, own encryption keys or a specific region. Whatever you choose, test that the tenant filter is enforced on every query path, including admin tools and caches.

Operations: HA, backup, DR, upgrades

Step six is operations, which decides whether you sleep at night. For high availability, check that replicas can sit in different zones, and what happens to writes when a node dies. For backup, check snapshots or point-in-time restore, and measure how long a restore takes at your data size. For disaster recovery, choose between a cross-region replica and rebuilding from your stored embeddings, and know the recovery time of each. Ask whether you can add shards online or must re-create the collection. Ask whether upgrades are rolling and whether on-disk formats stay compatible. Self-hosted Milvus, for example, also depends on etcd, object storage and a message queue, which you must run too. And confirm there are good metrics for memory, latency, slow queries and index status.

Security and compliance

Step seven is security and compliance. Check that the database can sit behind a private endpoint or V P C peering, with no public endpoint. Check identity: single sign-on with Entra ID or your identity provider, role-based access per collection, and API key rotation. Check encryption at rest with your own keys, and T L S in transit. Confirm the region where data, backups and support access live. Remember that the text chunks and metadata you store often contain personal data, and embeddings themselves can leak information about the original text, so treat the vector store with the same care as the source system. Finally, check audit logging: who queried or exported what, and when.

Build a cost model

Step eight is cost. For most deployments the biggest driver is memory for the vectors and the graph, so fewer dimensions, quantization and disk based indexes give the largest savings. Next come replicas, so size them to measured peak load, not guesses. Serverless services charge per read and write unit, so batch your upserts, cache frequent queries and avoid re-embedding unchanged data. Embedding generation itself costs money: embed once, and store the vectors with the model version. And do not forget engineering and on-call time, which often outweighs the infrastructure. Model the cost at one, three and ten times today's data and traffic. Serverless usually wins when you are small and spiky. Provisioned capacity usually wins when you are large and steady.

From requirements to a shortlist

Here is the decision flow as a picture. If you already run PostgreSQL, expect fewer than about fifty million vectors and moderate query rates, start with pgvector. If not, and a search engine is already in place or you need keyword plus vector search, use Azure AI Search, Elasticsearch or OpenSearch. If you want no servers to run and your data may live in a software as a service region, shortlist the managed services: Pinecone, Zilliz Cloud, Qdrant Cloud or Weaviate Cloud. If you are heading to hundreds of millions or billions of vectors, or need GPU or disk based indexes, look at distributed Milvus. Otherwise, Qdrant or Weaviate self-hosted give strong filtering and a simple footprint. And for a prototype, Chroma or pgvector on one machine is fine, but re-run this flow before production. Treat the result as a shortlist of two or three, not a final answer.

Shortlist at a glance

This table gives a directional summary of the shortlist. pgvector fits up to tens of millions of vectors when your data is already in Postgres, with hybrid search through SQL, and low effort if you have a database team. Azure AI Search suits enterprise retrieval on Azure, with native hybrid search and a semantic ranker. Elasticsearch and OpenSearch fit when you already run search clusters. Qdrant is excellent for filter-heavy workloads on single nodes or mid-size clusters. Weaviate is strong for many tenants. Milvus targets billions of vectors with GPU and disk indexes, but has the most moving parts. Chroma is great for prototypes and local apps. And Pinecone suits teams with no operations capacity. Features change quickly, so verify every row against current documentation during your bake-off.

Run a bake-off before you commit

Never choose from a feature matrix alone. Run a bake-off with two or three candidates. Use your own data: a one to ten percent sample with real metadata, and a golden set of one to three hundred real queries. Compute ground truth with flat, exact search, then measure recall at 10 for each candidate at fixed settings. Load test at your peak query rate with your real filters switched on, and record P 95 and P 99 latency. Measure ingest time, index build time and memory per million vectors, so you can extrapolate. Then test operations: kill a node, restore a backup, and upgrade a version, and time each one. Agree the scoring weights before the test starts, so the result is not argued afterwards.

Common mistakes

Here are the mistakes we see most often. Choosing from public benchmarks, which rarely match your data, filters or query rate. Ignoring filters until production, then finding queries return too few results. Sizing for today, then running out of memory in six months. Not storing the source text and embedding model version, which makes any migration painful. Using the wrong distance metric for the embedding model, which quietly lowers quality. And not monitoring recall, so quality drifts after an upgrade or a settings change. The fix for the last one is simple: re-run your golden set after every change.

Keep the choice reversible

Finally, keep the choice reversible. Store the chunks, metadata, embeddings and embedding model version in your data lake or main database. The vector database is an index, not the source of truth. Put a thin retrieval layer, your own small A P I, between the application and the database, so a later move touches one service instead of every app. Use product-only features in core paths only when they clearly earn their lock-in. Practise a full re-index, because you will need it for a model change, for disaster recovery and for any migration. And review the decision once a year against your growth and the market.

Full guides on HubDatAI

To recap: check whether an extension is enough, size the memory, understand your query pattern and filters, review operations, security and cost, shortlist two or three options, and prove the choice with a bake-off on your own data. For the detailed written guides, including H N S W tuning, quantization, filtered search, retrieval evaluation and moving to pgvector, visit HubDat AI dot com. Thanks for watching.