Prompts Forms Resume Reports ★ Saved ★ Saved★ + Submit a tool
Tools and frameworks

Milvus Vector Database

About 3897 characters Updated Nov 30, 2026 27 views AI wiki

Milvus is an open-source distributed vector database built for similarity retrieval at billion-vector scale. Led by Zilliz and donated to the LF AI & Data Foundation, it sits at the storage and retrieval layer of large-scale AI applications, and is one of the earliest systems in the vector database field to complete cloud-native transformation, with one of the richest sets of index types.

Core principles

Milvus adopts a cloud-native architecture with storage and compute separated. The access layer is the Proxy, handling request routing and result aggregation; the coordination layer has RootCoord, DataCoord, QueryCoord and IndexCoord, managing metadata, data writes, query scheduling and index building respectively; the execution layer has QueryNode for retrieval and DataNode for writes and persistence. The bottom layer relies on object storage (such as MinIO/S3) for logs and segment files, on a message queue (such as Pulsar/Kafka) for change logs, and on etcd for metadata. This split keeps writes, index building and queries from blocking each other, and each can scale horizontally.

In the data model, a collection consists of several fields, must have a primary key and at least one vector field, and may carry scalar fields and partitions. Written data first enters a growing segment; once a threshold is reached the segment is sealed and indexed asynchronously. Retrieval follows "coarse filtering then fine ranking": an index narrows the candidates first, then the original vectors compute exact distances.

Index types are Milvus's core asset: FLAT brute-force search, exact but slow, suitable for validating small datasets; IVF_FLAT clusters into buckets and searches by nprobe; IVF_PQ uses product quantization to compress, greatly cutting memory at some accuracy cost; IVF_SQ8 scalar quantization; HNSW graph index with balanced recall and latency; DiskANN puts the index on disk, suiting very large scale at low cost; GPU indexes (CAGRA and others) use graphics cards for acceleration; SCANN targets high throughput. Sparse vectors have their own dedicated index support.

Key points

Core operation APIs include create_collection, insert, create_index, load, search and query. A collection must be loaded into memory before it can be searched, which is the step where beginners most often get stuck. Metrics include L2, IP and COSINE, with IP commonly used for sparse vectors. Scalar filtering can be combined with vector search, with partition pruning based on scalars.

Its strength is scale and freedom in index choice; the price is operational complexity, with many dependent components and cluster deployment that needs careful planning. Lightweight scenarios can use Milvus Lite or the standalone version, or switch to the lighter Qdrant or pgvector. If the data volume is within millions and Postgres is already in place, pgvector is often less trouble.

The key to understanding Milvus is to accept its "componentized" nature: its strength comes from splitting each responsibility among roles that can scale independently, and the price is that deployment and tuning require more knowledge. For projects that evolve over time with steadily growing data, this upfront investment is diluted by scale benefits; for small projects that need quick validation, it may be overkill. When choosing, run a load test with real data volumes first, then decide between standalone, the lightweight version or a full cluster.

Common misconceptions

A common mistake is to deploy a distributed cluster without assessing scale, multiplying operational costs several times over. Another is to fetishize compressed indexes, using IVF_PQ to save memory while recall falls short. Some also forget that loading is required after the index is built, or write data and search immediately, failing to find it because it has not been flushed, and misjudging it as data loss.

On parameter tuning, the nlist of IVF variants affects bucket granularity and nprobe affects how many buckets are scanned at query time, together determining recall and latency; PQ's m and nbits determine the compression ratio and accuracy loss; HNSW's M and ef affect graph quality. There is no universal optimum; only repeated load tests combining data distribution and business tolerance. Index selection should serve the query pattern, not chase a theoretical best.

Application scenarios

Very large RAG knowledge bases, image and video deduplication and retrieval, recommendation candidate recall, multimodal vector search, similar sample comparison in security, and enterprise multi-tenant vector platforms.