Vector Milvus

Milvus is an open-source vector database built for large-scale workloads. The project belongs to the LF AI and Data Foundation. Its design separates storage from computing, which lets teams scale each part on its own.

Deployment Flavors

FlavorDescriptionBest For
Milvus LiteA lightweight version that runs inside a Python program and saves to a local fileLearning and prototypes
StandaloneAll components in one Docker containerDevelopment and mid-sized projects
DistributedComponents spread across a Kubernetes clusterLarge production systems
Managed serviceHosted version run by a providerTeams that skip infrastructure work

The Data Model

MILVUS DATA MODEL

Database
  |
  +-- Collection  (like a table)
        |
        +-- Partition  (optional slice of data)
        |
        +-- Entity  (like a row)
              |
              +-- primary key
              +-- vector field
              +-- scalar fields (text, numbers, dates)
  • Collection: The main container with a fixed schema.
  • Entity: One record with a key, a vector, and scalar fields.
  • Partition: A subdivision of a collection. Searching a single partition skips irrelevant data and saves time.

Architecture in Plain Terms

Milvus divides work among specialized roles. A restaurant offers a helpful picture: the waiters take orders, the cooks prepare food, and the pantry stores ingredients. Each group scales independently.

MILVUS LAYERS

  +--------------------------------------+
  |  Access Layer   (receives requests)  |
  +--------------------------------------+
                    |
  +--------------------------------------+
  |  Coordinators   (plan and schedule)  |
  +--------------------------------------+
                    |
  +--------------------------------------+
  |  Worker Nodes   (search, insert,     |
  |                  build indexes)      |
  +--------------------------------------+
                    |
  +--------------------------------------+
  |  Storage        (object storage,     |
  |                  metadata, logs)     |
  +--------------------------------------+

High search traffic calls for more query workers. Heavy data loading calls for more data workers. You add only the part you need.

A First Example in Python

from pymilvus import MilvusClient

client = MilvusClient("demo.db")   # Milvus Lite stores data in this file

client.create_collection(collection_name="docs", dimension=4)

client.insert(
    collection_name="docs",
    data=[
        {"id": 1, "vector": [0.1, 0.9, 0.3, 0.2], "topic": "travel"},
        {"id": 2, "vector": [0.8, 0.1, 0.2, 0.7], "topic": "cooking"},
    ],
)

results = client.search(
    collection_name="docs",
    data=[[0.1, 0.8, 0.4, 0.2]],
    limit=2,
    output_fields=["topic"],
)

Index Choices

Milvus supports many index types, so you can match the index to the workload.

IndexStrength
FLATExact results on small data
IVF_FLATBalanced speed and accuracy
IVF_PQStrong compression for huge data
HNSWFast, high-recall graph search
DiskANNLarge datasets that exceed memory

Special Features

  • Hybrid search: Combine several vector fields or mix vector and keyword signals in one request.
  • Dynamic fields: Store extra attributes without defining each one upfront.
  • Time travel and backups: Recover data and protect against mistakes.
  • Multi-tenancy: Separate customer data using partitions or collections.

When Milvus Fits Well

  1. Your dataset grows toward hundreds of millions of vectors.
  2. Your team already runs Kubernetes.
  3. You want fine control over index types.
  4. You need independent scaling of search and data loading.

When a Simpler Tool May Suit Better

A small project with a few thousand documents does not need a distributed system. Milvus Lite or a lighter database keeps things simple. Move to a full Milvus deployment when data volume or traffic demands it.

Milvus rewards teams that plan for scale. Begin with Milvus Lite, learn the collection and index concepts, and graduate to a distributed setup when your workload grows.