Glossary
Vector database
A vector database stores numerical vectors that represent the meaning of text, images, audio or other content, and returns the stored vectors closest to a query vector. Retrieval is by mathematical proximity rather than by exact match on a field value.
The vectors are produced by an embedding model, which maps content into a coordinate space arranged so that proximity corresponds to similarity of meaning. A query about storage failure can therefore return a passage describing a drive that stopped responding, with no word in common between them. Vector databases exist because this form of retrieval, finding nearest neighbours in a space of several hundred to several thousand dimensions, is costly to compute directly and depends on index structures that relational and document databases do not provide.
Embeddings and the vector representation
An embedding model converts a piece of content into a fixed-length list of numbers. The length is the model's dimensionality and is a property of the model, not of the content: a one-sentence passage and a one-page passage submitted to the same model both return a vector of the same length.
Dimensionality commonly falls between 384 and 3,072. Each value is usually a 32-bit float, so a 1,536-dimension vector occupies 1,536 multiplied by 4 bytes, or 6,144 bytes. Many models return vectors normalized to unit length, which simplifies the distance calculation described below.
Content longer than a model's input limit is divided into chunks before embedding, and each chunk becomes its own vector with its own entry in the database. The chunk boundaries therefore determine what can be retrieved: a fact split across two chunks is present in neither vector in complete form.
Distance and similarity measures
Three measures are in general use, and for normalized vectors they are closely related.
Dot product multiplies the two vectors element by element and sums the results, giving one number per comparison.
Cosine similarity is the dot product divided by the product of the two vectors' lengths, which removes magnitude and leaves only direction. For vectors already normalized to unit length the divisor is 1, so cosine similarity and dot product return the same value.
Euclidean distance measures straight-line separation. For unit-length vectors it carries the same ordering as the other two, since the squared distance between vectors a and b equals 2 minus twice their dot product: a larger dot product is exactly a smaller distance. The choice among the three therefore affects the arithmetic and the index implementation more than the ranking, provided the vectors are normalized and the same measure is used at indexing and query time.
Exact search and its cost
Exact nearest-neighbour search compares the query vector against every stored vector and keeps the closest k. It is correct by construction, and its cost is linear in both the size of the collection and the dimensionality.
A collection of 100 million 1,536-dimension vectors requires 100,000,000 multiplied by 1,536 multiply-add operations for a single query, or approximately 1.5 times 1011 operations, with the full 614 GB of vector data read for each query. This is the reason approximate indexes exist. At small scale, a few tens of thousands of vectors, exact search is fast enough that no index is needed.
Approximate nearest neighbour indexes
Approximate indexes reduce the number of comparisons by restricting search to a promising subset of the collection, accepting that the true nearest neighbours are occasionally missed.
| Index | Method | Comparisons per query | Memory beyond the vectors |
|---|---|---|---|
| Flat | Compares against every vector | The whole collection | None |
| IVF | Partitions the space into cells around centroids; searches only the cells nearest the query | A tunable fraction of the collection | The centroid list |
| HNSW | Builds a layered proximity graph and descends it greedily from a sparse top layer | Grows roughly with the logarithm of collection size | A fixed number of links per vector |
| Product quantization | Splits each vector into sub-vectors and replaces each with a code from a learned codebook | Unchanged, but each comparison is far cheaper | The codebooks, with a large reduction in vector storage |
Quantization changes the footprint rather than the search path, and is usually combined with one of the others. Splitting a 1,536-dimension vector into 96 sub-vectors of 16 dimensions and encoding each as a single byte yields 96 bytes per vector in place of 6,144, a reduction of 64 times, at the cost of computing distances against approximations of the original vectors.
Recall and the accuracy trade-off
The accuracy of an approximate index is measured as recall at k: the proportion of the true k nearest neighbours that the index actually returns. An index asked for the 10 nearest vectors that returns 9 of the true 10 has a recall at 10 of 0.9.
Recall is tunable at query time. An IVF index probes a configurable number of cells, and an HNSW index explores a configurable number of candidates during its descent. Raising either raises recall and raises query time with it, along a curve that flattens: the last few percentage points of recall generally cost more than all the preceding ones.
Recall is measured against exact search over the same collection, so establishing it requires running the exact search that the index exists to avoid. It is therefore evaluated on a sample of representative queries rather than continuously.
Metadata filters and hybrid retrieval
Vectors are stored alongside structured fields: source document, author, date, access group, language. Restricting a search by those fields can be applied before or after the vector search, and the two behave differently.
Applied afterwards, the search returns k results and the filter removes some, so a restrictive filter can leave very few. Applied beforehand, the search is confined to matching vectors, which preserves the result count but interacts badly with graph indexes, whose traversal depends on links that the filter may have removed. Implementations differ in how they resolve this, and the behaviour under highly selective filters is a substantive difference between them.
Hybrid retrieval combines vector similarity with keyword scoring, which remains better at exact terms such as part numbers, error codes and proper nouns that an embedding model represents only approximately. The two result lists are merged by a scoring rule. Retrieval quality is what determines whether a generation step has the right material to work from, which is treated in RAG hallucination.
Storage footprint and the source corpus
The vectors themselves are compact per item and substantial in aggregate. One hundred million 1,536-dimension float32 vectors occupy 614 GB before index structures, metadata and replicas; the same collection under 96-byte quantization occupies approximately 9.6 GB, which is the difference between a collection that fits in memory on one machine and one that does not.
Those vectors are derived data. The documents, images and records they were computed from, the chunk boundaries, and the model version used are held separately, normally in object storage or a data lake. The dependency becomes concrete when the embedding model changes: vectors from different models are not comparable, so a model change requires re-reading the entire corpus and recomputing every vector. The source collection is read in bulk during embedding and selectively during retrieval, when a passage is fetched to be shown or passed to a model. The AI data pipeline covers the stages around this.
Vector databases and Scality
Scality RING provides S3-compatible object storage for the corpus a vector database is built from, rather than for the vector index itself. The access pattern that implies is two-sided: bulk sequential reads of the whole collection whenever embeddings are generated or regenerated, and selective reads of individual documents during retrieval.
Capacity on that side of the system is governed by the source content rather than by the vectors, and the two scale differently. A corpus of scanned documents or video can be several orders of magnitude larger than the embeddings computed from it, while the vectors are the part that must stay close to the query path.














