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
| Flavor | Description | Best For |
|---|---|---|
| Milvus Lite | A lightweight version that runs inside a Python program and saves to a local file | Learning and prototypes |
| Standalone | All components in one Docker container | Development and mid-sized projects |
| Distributed | Components spread across a Kubernetes cluster | Large production systems |
| Managed service | Hosted version run by a provider | Teams 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.
| Index | Strength |
|---|---|
| FLAT | Exact results on small data |
| IVF_FLAT | Balanced speed and accuracy |
| IVF_PQ | Strong compression for huge data |
| HNSW | Fast, high-recall graph search |
| DiskANN | Large 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
- Your dataset grows toward hundreds of millions of vectors.
- Your team already runs Kubernetes.
- You want fine control over index types.
- 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.
