Vector Embedding Storage: Save RAM in 2026

Vector Embedding Storage: Save RAM in 2026

How much RAM does one million embeddings actually need? The answer surprises most teams the first time they do the math. A single 1,536-dimension float32 vector takes 6,144 bytes. Multiply that by a million and you are already at roughly 6.1 GB of raw vector data, before any index overhead. Scale to a hundred million chunks of text and the same math lands near 614 GB. Storage decisions that seem like a footnote during prototyping become the main budget line in production.

This article walks through what embeddings are, how much space they really take, which compression tricks work, and where the practical traps hide.

What an embedding actually is, and why its size matters

An embedding is a dense list of numbers, usually between 128 and 4,096 floating-point values, that captures the meaning of a piece of text, an image, or audio. Items with similar meaning end up close together in vector space. The idea traces back to the original word2vec work by Mikolov and colleagues, which showed that learned vectors could encode semantic relationships.

The practical consequence is simple. Every item you want to search over needs its own vector, stored somewhere, loaded fast, and compared against a query vector at search time. Unlike a row in a table, a vector is not read in isolation. Search touches many of them at once. That is why embedding storage behaves less like a database and more like an in-memory data structure with a persistence problem attached. (Vector database)

The arithmetic everyone should run first

The arithmetic everyone should run first

Before choosing a database, run the size calculation. It takes two minutes and prevents months of regret.

Dimension Bytes per vector (float32) 1M vectors 100M vectors
384 1,536 ~1.5 GB ~154 GB
768 3,072 ~3.1 GB ~307 GB
1,536 6,144 ~6.1 GB ~614 GB
3,072 12,288 ~12.3 GB ~1.2 TB

These figures come straight from the definition of single-precision floating point, where each value occupies 32 bits, or 4 bytes. The float32 format is standardized and well documented, so the math is not controversial. What is controversial is everything that gets added on top: index structures, metadata, replicas, and the working memory needed to build the index in the first place.

A common mistake is sizing for the raw vectors and forgetting the index. A graph-based index can add substantial overhead per vector. Teams that budget for 6 GB and then watch the process hit 20 GB of resident memory learn this lesson the hard way.

Exact search versus approximate search

The simplest way to find similar vectors is to compare the query against every stored vector. That is exact nearest-neighbor search, and it costs roughly n times d operations per query, where n is the number of vectors and d is the dimension. It is perfectly fine for ten thousand vectors. It falls apart at ten million.

The standard answer is approximate nearest neighbor (ANN) search, which gives up a small amount of accuracy in exchange for a large speed gain. The HNSW algorithm, described in the original hierarchical navigable small world paper by Malkov and Yashunin, builds a multi-layer graph where each vector links to nearby neighbors. Queries walk the graph instead of scanning the whole collection.

The trade-off is worth understanding precisely. You store a graph over the vectors along with the vectors themselves. That graph makes queries fast, and it also raises memory usage and update costs.

Choosing a similarity metric

Most retrieval systems rank by cosine similarity or inner product. Here is the detail that saves confusion: if your vectors are L2-normalized to unit length, cosine similarity and dot product produce identical rankings. Many teams normalize at write time and then use the cheaper dot product at query time. The FAISS documentation on metric types and distances explains how each metric maps to specific index types, which matters because some indexes only support some metrics.

Compression: the real lever on storage cost

If raw float32 vectors are too large, the answer is not usually “buy more RAM.” It is compression. Three approaches dominate.

Product quantization

Product quantization (PQ), introduced by Jégou and colleagues in their 2011 paper on product quantization for nearest neighbor search, splits each vector into sub-vectors and replaces each sub-vector with a short code pointing at a learned centroid. The result is a dramatic reduction in memory, often down to a few dozen bytes per vector, at the cost of some recall. Inverted-file indexes combined with PQ are a classic way to keep billions of vectors searchable on modest hardware.

Scalar quantization to int8

A gentler option is converting float32 values to int8. Each value drops from 4 bytes to 1 byte, a roughly 4x reduction, with recall loss that is often small enough to be acceptable. This is a good first step for teams that want savings without a research project.

Binary embeddings

At the extreme, vectors can be binarized into bit strings, cutting memory by roughly 32x versus float32. Similarity then becomes a Hamming distance computation, which is extremely fast. Recall drops noticeably, so binary codes usually work best as a first-stage filter followed by a reranking pass on full-precision vectors. Research on learning binary hash codes explores how to train models so that binarization loses as little information as possible.

The honest summary: every compression method is a trade between memory, latency, and recall. No single percentage applies to every dataset. Treat any vendor’s headline savings figure as workload-specific until you have measured it on your own data.

Dedicated vector databases versus extensions

There are two broad architectural camps, and the choice matters more for operations than for raw speed.

The first camp is dedicated vector databases, which are built from the ground up around ANN indexes. They usually offer strong performance, managed scaling, and features like filtering and hybrid search.

The second camp adds vector support to systems you already run. The best-known example is pgvector, an extension that adds vector column types and ANN indexes (IVFFlat and HNSW) to PostgreSQL. If your application already lives in Postgres, this approach keeps vectors next to your relational data, which simplifies joins, transactions, and backups enormously. (Blog)

Neither camp is universally better. Teams with a small corpus and an existing Postgres deployment often find the extension approach far less work. Teams with hundreds of millions of vectors and strict latency targets often need the dedicated path. For background on how these infrastructure choices play out in practice, the cloud section of 9481.org covers deployment patterns worth reading alongside this article. (Cloud)

Operational realities that documentation glosses over

Storage is the easy part to reason about. The harder part is everything that happens after the index exists.

Index builds are expensive

Building an HNSW index over a large collection takes real time and real memory. The index is typically memory-resident, so steady-state memory use includes the graph as well as the vectors. Teams routinely skip planning for peak memory during a rebuild.

Updates are not free

Inserting a new vector into a graph index is not a simple append. The graph must be repaired so that navigation still works. Bulk reindexing after large deletions is a normal maintenance task, not an emergency.

Deletes leave debris

Many ANN indexes handle deletion by marking entries as removed rather than physically removing them. Over time, the index fills with tombstones and recall quietly degrades. Scheduled rebuilds fix this, but only if someone remembers to schedule them.

Metadata filtering gets tricky

Real queries usually combine a vector similarity search with a filter, such as “only documents from this tenant” or “only items published this year.” Filtering before the ANN search can shrink the candidate set so much that the index stops helping. Filtering after can return too few results. Most mature systems offer a hybrid strategy, but it is worth testing with your actual filter selectivity rather than assuming.

Practical tips that actually hold up

A few habits separate teams that scale smoothly from teams that rebuild their stack every eighteen months.

  • Normalize vectors at write time if you plan to use cosine similarity. It makes the cheaper dot product valid and removes a class of bugs.

  • Store the original text and metadata separately from the vectors. You will want to re-embed with a better model eventually, and keeping the source data clean makes that migration possible.

  • Version your embedding model in a column or field. Mixing vectors from two different models in one index produces meaningless similarity scores, and it happens more often than anyone admits.

  • Measure recall, not latency alone. A fast index that misses relevant results is worse than a slower one that finds them. Build a small labeled evaluation set early.

  • Start with exact search. If your corpus is under a few hundred thousand vectors, brute-force search may be fast enough, and it removes an entire category of tuning work.

  • Budget for replicas. High availability doubles or triples your memory footprint, and that multiplication applies to the index too.

For ongoing coverage of how these trade-offs evolve as tooling matures, the news section at 9481.org tracks relevant developments. (News)

Common mistakes worth avoiding

The single most common error is choosing an index before measuring the workload. A team reads that HNSW is the default choice, adopts it, and then discovers that their update-heavy write pattern makes graph maintenance painful. A different team picks IVF-PQ for memory savings and finds that recall on their domain-specific data is unacceptable without extensive tuning.

The second most common error is forgetting that embeddings are model-dependent. Swap the model, and every stored vector becomes stale. Storage design should assume at least one full re-embedding will happen, which means the pipeline needs to handle writing a second copy of vectors alongside the first while the migration runs.

The third is treating the vector store as a black box. Understanding roughly what the index does internally, whether it is a graph, a set of inverted lists, or a tree, tells you what will be slow and what will be cheap.

Conclusion

Vector embedding storage is arithmetic first and architecture second. Start with the dimension count and the row count, multiply out the bytes, and add a healthy margin for the index. Then decide whether exact search is good enough, whether compression is worth the recall cost, and whether a dedicated vector database or an extension to an existing system fits your team better.

The teams that get this right tend to be the ones that measured before they chose. They normalized their vectors, versioned their models, kept their source data clean, and scheduled their index rebuilds. None of that is glamorous. All of it is what keeps a retrieval system fast and affordable as the corpus grows from thousands to hundreds of millions of items.

FAQ

How much memory does one million embeddings need?

It depends entirely on dimension and precision. At 1,536 dimensions stored as float32, one million vectors take about 6.1 GB of raw data. At 768 dimensions, it drops to roughly 3.1 GB. Add index overhead, replicas, and build-time working memory on top of those numbers.

Is cosine similarity better than dot product?

Neither is inherently better. For L2-normalized vectors, they produce identical rankings. Cosine similarity is easier to reason about because it ignores magnitude, while dot product is slightly cheaper to compute. Many production systems normalize at write time and use dot product at query time.

Do I need a dedicated vector database?

Not always. If your corpus is modest and you already run PostgreSQL, the pgvector extension may cover your needs with far less operational overhead. Dedicated vector databases tend to make more sense at very large scale or when you need specialized features like advanced filtering and hybrid search.

How much memory does quantization actually save?

Scalar quantization to int8 typically cuts vector memory by about 4x. Product quantization can reduce it far more, often to a few dozen bytes per vector. Binary embeddings can reach roughly 32x savings versus float32. Every method costs some recall, and the exact loss depends on your data and tuning.

Why does my vector index use more memory than the raw vectors?

Because the index is a separate data structure. Graph-based indexes like HNSW store neighbor links for every vector, and those links consume memory on top of the vectors themselves. The index also usually needs to be resident in memory to deliver low query latency, so the working set is vectors plus graph.

How often should I rebuild a vector index?

There is no universal schedule. Rebuild when recall has measurably degraded, after large batches of deletions, or after a significant data distribution shift. Monitoring recall against a small labeled evaluation set is the most reliable trigger, and it beats rebuilding on a fixed calendar.

Latest articles

Scroll to Top