Vector DBs & RAG (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
Real-Time Vector Ingestion: Handling continuous document updates, deletes, and the "Stale Embeddings" problem.
senior LevelMost Askedvector-databasesAdvanced Internals
In Simple Words: When source documents (Notion docs, Jira tickets, SQL tables) update frequently:
- Hash-Based Change Detection: Compute SHA-256 hash of each chunk text. Store
{ chunk_id: sha256_hash }. If the hash is identical, skip re-embedding. - Soft Deletes & HNSW Graph Compaction: In graph indexes (HNSW), deleting a vector immediately leaves orphaned edges. Vector databases mark nodes as deleted (tombstone) and trigger background vacuum compaction during idle windows.
- Model Drift / Stale Embeddings: If you upgrade the embedding model (e.g. from OpenAI
ada-002totext-embedding-3-small), you cannot mix old and new vectors in the same index. You must re-embed all documents in a parallel index before cutting over.