Which vector database would you choose for a RAG application with 2 million chunks that also needs keyword search and document permissions?
Short answer
At 2 million chunks, a search engine with hybrid (BM25 + vector) search and efficient metadata filtering, or PostgreSQL with pgvector plus full-text search, is usually sufficient. Choose based on existing platforms and operational skills; ensure permission filters are applied inside the query, and plan for embedding model upgrades.
Detailed answer
- Size: 2M × 1024 dims × 4 bytes ≈ 8 GB raw; fits easily on one node with HNSW.
- Options: pgvector (if PostgreSQL already used, permissions and metadata in SQL, hybrid with tsvector), OpenSearch/Elasticsearch/Azure AI Search (strong hybrid and filtering), managed vector DBs for larger scale or low ops.
- Must-haves: hybrid search, pre-filtering by ACL, quantization option, reindexing strategy, backups.
What the interviewer expects
Sizing math, hybrid search awareness, permission enforcement.
Common mistakes to avoid
Choosing a separate specialized vector DB by default, adding a new operational system without need.