Keep float16 vectors, and search compressed codes in an inverted file
A billion vectors need a storage plan before they need a search.
Bytes for each vector: 3,328, 3,072, 1,536, 768, 64 and 32.
Keep the float16 vectors in object storage as the source of truth, and build compressed indexes for search.
At this size, compression isn't optional. The Faiss documentation says every Faiss index is stored in RAM. Its page on billion-scale indexes says that for 10 million to a billion vectors per server, compression becomes mandatory.
Product quantization (PQ) stores each vector as a short code. Faiss's PQ index makes M-byte codes, so with M = 64 a vector takes 64 bytes. Then 64 GB of codes plus 8 GB of 64-bit IDs fits on one large machine.
The popular graph index, HNSW, doesn't fit: it's the top bar. Faiss gives its memory use as bytes per vector, where is the dimension and the number of links per vector. With and , that's bytes, or 3.3 TB of RAM for a billion.
For 100 million to a billion vectors, the same guide recommends an inverted file with about a million lists over compressed codes, IVF1048576_HNSW32. Read the name in two parts:
IVF1048576is the inverted file, with lists.HNSW32is an HNSW graph over the million list centroids. It finds the lists nearest a query.
The design method lesson shows how IVF and HNSW work inside. What matters here is which searches you need.
In the editor, write bytes_per_vector(kind) for the five ways to store one vector in the chart, and total_tb(n, per_vector) for a billion of them.