Database / Qdrant Vector DB Interview questions
What is the difference between keeping vectors on-disk versus the HNSW index in RAM?
Qdrant allows independently configuring whether raw vector data lives on disk or in memory, separately from whether the HNSW index structure itself is kept in RAM, which gives fine-grained control over the memory/performance trade-off beyond the basic in-memory-versus-memmap choice.
client.update_collection( collection_name="documents", hnsw_config=models.HnswConfigDiff(on_disk=False), # keep HNSW graph in RAM ) client.update_collection( collection_name="documents", quantization_config=models.ScalarQuantization( scalar=models.ScalarQuantizationConfig(type=models.ScalarType.INT8, always_ram=True) ), )
A common, memory-efficient production pattern is keeping the HNSW graph structure and quantized vectors in RAM (since graph traversal and initial candidate scoring benefit most from fast access) while placing the original, full-precision vectors on disk (since they're only touched during the much smaller rescoring step, not the full initial search).
This separation matters because the HNSW graph itself is relatively compact compared to the raw vector data it indexes; keeping just the graph and compressed vectors in RAM, with full-precision originals on disk, can support collections far larger than available RAM while still keeping the latency-critical parts of a search fast, striking a middle ground between pure in-memory and pure memmap-everything configurations.
More Related questions...