In-memory minimizes latency; on-disk minimizes RAM cost
Storing vectors in-memory means they are allocated on the heap and always resident in RAM. Distance computations during HNSW traversal and rescoring hit memory directly, with no page faults and no disk I/O. This gives the lowest and most predictable latency, but it requires enough RAM to hold the full-precision vectors, the HNSW graph, and the payload indexes. Storing vectors on-disk means they are memory-mapped and paged in on demand. RAM usage drops dramatically - only the working set needs to be resident - but latency becomes a function of cache hit rate, and cold reads add tens of microseconds to tens of milliseconds per access. The practical difference is therefore RAM cost against latency predictability, and the right choice depends on which of those is the binding constraint for your workload.
The decision is not binary, because Qdrant lets you mix storage modes per component. You can keep the HNSW graph in RAM but the raw vectors on disk, so traversal is fast and only rescoring touches disk. You can quantize the vectors and keep the quantized versions in RAM while the full-precision versions stay on disk, so traversal uses the in-RAM quantized vectors and rescoring fetches the raw vectors for a small candidate set. You can put everything on disk for a cold tier. The most common production pattern for large collections is the hybrid: quantized vectors in RAM, graph in RAM if it fits or on disk if it does not, raw vectors on disk. This gets you close to in-memory latency for the traversal phase while keeping the RAM footprint proportional to the quantized data rather than the full float32 data. The full-precision vectors are only touched during rescoring of a small candidate set, so the disk I/O is bounded and predictable.
In-memory vectors: lowest latency, highest RAM cost, appropriate for latency-critical high-QPS collections that fit in RAM.
On-disk vectors: lower RAM cost, variable latency, appropriate for collections much larger than RAM, low-QPS, or cost-sensitive workloads.
Hybrid: quantized vectors in RAM + raw vectors on disk + graph in RAM or on disk. Usually the best large-scale configuration.
Graph placement is a separate decision from vector placement; you can mix them.
Payload indexes are usually kept in RAM because they are small and their access pattern is latency-critical.
I choose on-disk when the collection is much larger than the machine's RAM, when the query rate is low enough that occasional cold reads are acceptable, when the workload is a cold tier that is queried infrequently, or when cost pressure makes RAM the dominant expense. I keep things in memory when the collection fits comfortably and the workload is latency-critical, or when the p99 SLO is tight enough that variable disk latency would violate it. The common mistake is assuming on-disk always means slow. With binary quantization, inline storage of quantized vectors in graph nodes, and rescoring over a small candidate set, an on-disk collection can serve queries in single-digit milliseconds - it is not the same as a naive disk-backed search. The second common mistake is sizing RAM by counting vectors only. The graph and payload indexes can dominate memory on large collections, so a collection whose raw vectors fit in RAM may still not fit once the graph is added. The third mistake is ignoring NVMe versus spinning disk: on-disk is a very different proposition on NVMe (hundreds of microseconds per read) than on HDD (tens of milliseconds). Version note: the on_disk flags and the interaction between vector, graph, and quantization storage have changed across releases, and the defaults differ - always inspect the effective config.
Version-dependent: the on_disk flag exists on vector params, HNSW config, and some quantization configs, but its exact behavior and defaults have changed across releases. In some versions, the optimizer's memmap_threshold determines whether a segment is stored on disk regardless of the per-vector flag, which means the effective storage mode is a combination of the two. If you need deterministic storage behavior, set both the per-vector flags and the optimizer thresholds explicitly, and verify with get_collection after creation.
You have a 1M-vector collection and 8 GB of RAM. Would you store vectors in memory or on disk, and why?
A teammate says on-disk is always slower than in-memory. Explain a case where on-disk with quantization and rescoring is competitive.
You must serve a 50M-vector collection on a node with 64 GB of RAM. Walk through the storage configuration you would choose and the expected latency profile.
Your in-memory collection is using too much RAM and you need to cut it by half without losing more than one point of recall. Describe the storage and quantization changes you would make, in order.
Design a two-tier storage architecture where a hot tier serves recent data in memory and a cold tier serves older data on disk, with a single logical collection. How would you route queries between tiers?
You have a 300M-vector collection on NVMe with a 30ms p99 SLO. Compare three configurations (all in-memory, graph in RAM + raw on disk, everything on disk with binary quantization) and recommend one with justification.
Derive the RAM required for a collection as a function of point count, dimension, m, quantization scheme, and payload index cardinality. Where does the estimate typically undercount in practice?
You are asked to reduce the infrastructure cost of a search cluster by 60% without dropping below a 0.95 recall target and a 40ms p99. Propose a storage and quantization plan and quantify the expected savings and risks.