Inferensys

Glossary

DiskANN

DiskANN is a graph-based approximate nearest neighbor search algorithm designed to store the index on solid-state drives (SSDs) rather than RAM, enabling cost-effective search over billion-scale vector datasets.
Engineer reviewing vector database search results on laptop, embeddings visualization on screen, home office coding session.
SSD-RESIDENT VECTOR SEARCH

What is DiskANN?

DiskANN is a graph-based approximate nearest neighbor (ANN) search algorithm that stores its vector index on solid-state drives (SSDs) rather than RAM, enabling cost-effective, low-latency search over billion-scale datasets.

DiskANN, or Disk-based Approximate Nearest Neighbor, is a graph-based ANN algorithm designed to overcome the memory limitations of in-memory indexes like HNSW. By storing the majority of the vector index on an SSD and only caching a small, navigable subset in RAM, it achieves a favorable ANN recall trade-off while dramatically reducing the hardware cost required to search massive, billion-scale vector datasets.

The algorithm constructs a graph index on the SSD and uses a small set of entry points cached in memory to initiate the search. During a query, DiskANN performs a beam search, strategically issuing a minimal number of parallel SSD reads to fetch the next set of candidate vectors. This architecture makes it a foundational technology for building economically viable, large-scale semantic indexing pipelines and vector database infrastructure.

SSD-OPTIMIZED VECTOR SEARCH

Key Features of DiskANN

DiskANN is a graph-based approximate nearest neighbor search algorithm that fundamentally re-architects the relationship between storage and memory, enabling billion-scale vector search directly from commodity SSDs.

01

SSD-Resident Index Architecture

Unlike in-memory algorithms like HNSW, DiskANN stores the Vamana graph index on solid-state drives, accessing only a tiny fraction of the graph during search. It exploits the high random-read IOPS of modern NVMe SSDs while minimizing the performance penalty of disk I/O. The algorithm intelligently caches only the most frequently traversed graph nodes in RAM, using a beam search that overlaps computation with asynchronous disk reads to hide latency. This design decouples dataset size from expensive DRAM capacity.

1B+
Scale (Vectors)
64GB
RAM for 1B Vectors
02

Vamana Graph Construction

DiskANN builds a directed graph named Vamana with a crucial property: the graph diameter is small and the out-degree of each node is bounded, ensuring fast traversal. Construction uses a greedy search with a pruning strategy that eliminates edges to nodes that are already reachable via shorter paths. This creates a navigable structure where the longest path between any two points is logarithmic relative to the dataset size. The pruning parameter, alpha, controls the graph density and directly tunes the recall-latency trade-off.

O(log N)
Search Complexity
03

Product Quantization Compression

To minimize storage footprint and I/O cost, DiskANN compresses the full-precision vectors stored on disk using Product Quantization (PQ). The original high-dimensional vector is split into sub-vectors, and each is independently quantized to a codebook. During search, distances are computed using asymmetric distance computation against the PQ codes, avoiding the need to decompress the full vector. This achieves a typical compression ratio of 8x to 32x with a negligible impact on recall, enabling billion-scale datasets to fit on a single server's SSDs.

8x–32x
Compression Ratio
04

Beam Search with Disk-Aware Caching

DiskANN's search uses a beam search that maintains a frontier of candidate nodes. It issues asynchronous read requests for the graph neighbors of frontier nodes, overlapping I/O with distance computation. A small, dynamic LRU cache in RAM holds the graph adjacency lists of frequently visited nodes, absorbing the locality inherent in the search traversal. This cache-aware design ensures that the algorithm saturates the SSD's queue depth without blocking on individual reads, achieving sub-millisecond latency per query on billion-scale datasets.

< 3ms
P99 Latency (1B Scale)
05

Freshness via Incremental Insertions

Unlike static indexes that require costly full rebuilds, DiskANN supports incremental insertion of new vectors directly into the Vamana graph. The algorithm performs a beam search to locate the neighborhood for the new point, then updates the graph edges using the same pruning strategy from construction. This allows the index to stay current with streaming data without blocking queries. Deletions are handled via a lazy tombstone mechanism, marking nodes as invalid and reclaiming space during periodic consolidation.

06

Filtered Search Integration

DiskANN natively supports predicate-based filtering during ANN search, combining vector similarity with structured metadata constraints. The algorithm applies filters during the beam search traversal, skipping graph nodes that do not match the predicate before computing distances. This avoids the post-filtering pitfall where a query returns zero results. The implementation handles complex boolean expressions on document tags, timestamps, and categorical attributes, enabling use cases like searching within a specific date range or product category.

VECTOR INDEX COMPARISON

DiskANN vs. HNSW vs. FAISS

Architectural and operational comparison of three leading approximate nearest neighbor search algorithms for billion-scale vector retrieval.

FeatureDiskANNHNSWFAISS

Primary Storage Medium

SSD (Solid-State Drive)

RAM (In-Memory)

RAM / GPU Memory

Index Build Time

Hours (Vamana graph construction)

Minutes to hours

Minutes (GPU-accelerated)

Memory Footprint

Minimal (< 64 GB for billion-scale)

High (index fully in RAM)

High (index fully in RAM/VRAM)

Billion-Scale Search

Incremental Index Updates

Query Latency (P99)

< 10 ms

< 1 ms

< 5 ms

Recall@10 (Typical)

95%

95%

95%

Hardware Cost Profile

Low (commodity SSD)

High (large RAM servers)

High (GPU instances)

DISKANN DEEP DIVE

Frequently Asked Questions

Explore the core mechanisms, performance trade-offs, and architectural benefits of Microsoft's DiskANN algorithm for cost-effective, billion-scale vector search.

DiskANN is a graph-based Approximate Nearest Neighbor (ANN) search algorithm specifically architected to store the vector index on Solid-State Drives (SSDs) rather than in expensive main memory (RAM). It works by constructing a Vamana graph, a directed graph where nodes represent vectors and edges represent neighbor relationships. During search, DiskANN navigates this graph using a beam search, but critically, it minimizes random reads by caching the graph's adjacency lists in a compressed format and performing only a few sequential SSD reads per query. This design leverages the high throughput of modern NVMe SSDs to achieve low-latency, high-recall search over billion-scale datasets at a fraction of the hardware cost of an in-memory solution like HNSW.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.