Milvus: Distributed Vector Database for Billion-Scale Search
Milvus is the leading open-source distributed vector database, purpose-built for billion-scale similarity search. With a cloud-native, microservices architecture, it independently scales storage, indexing, and query nodes. Supporting 12+ index types including HNSW, DiskANN, and GPU-accelerated indexes, Milvus powers the largest AI applications at companies like Salesforce, Walmart, and Roblox.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
JSON Formatter & Validator
Format, beautify, and validate JSON online. Paste your JSON to instantly pretty-print it with 2-space, 4-space, or tab indentation. Minify JSON too. Free, runs in your browser.
Open free tool →
Regex Tester
Free regex tester. Test regular expressions against multiple strings with expected match/no-match assertions — see instant pass/fail results. Built-in presets for email, URL, IPv4, and phone. Pro: unl
Open free tool →
Base64 Encoder & Decoder
Free Base64 Encoder & Decoder. Convert text, images, and any file to Base64 and back. Supports URL-safe Base64, image data URIs, and file download from Base64. Runs 100% in your browser — no data sent
Open free tool →
More Free Tools
Related Articles
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
Best AI Code Review Tools 2026: CodeRabbit, Sourcery, DeepCode & Bito Compared
Compare top AI code review tools for 2026: CodeRabbit, Sourcery, DeepCode, and Bito. Features, pricing, GitHub/GitLab integration, and choosing the right tool for your team.
AI Code Review Tools 2026: GitHub Copilot, CodeRabbit, Qodo Merge Ranked
Compare AI code review tools for 2026: GitHub Copilot code review, CodeRabbit, Qodo Merge, Sourcery, and PR-Agent. Pricing, accuracy, and GitHub integration.
AI Coding Tools Comparison 2026: GitHub Copilot vs Cursor vs Windsurf vs Cline
Comprehensive comparison of the best AI coding tools in 2026: GitHub Copilot, Cursor, Windsurf, and Cline. Pricing, features, model support, and real-world benchmarks.
AI Pair Programming in 2026: GitHub Copilot vs Cursor vs Claude Code
Master AI pair programming in 2026. Compare GitHub Copilot, Cursor, and Claude Code for autocomplete, chat, and agentic workflows. Includes setup guides and productivity tips.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →Quick Start: Docker Standalone & Collection Schema
Run Milvus standalone locally with Docker, then define a typed collection schema.
# Start Milvus standalone with Docker Compose
# curl -sfL https://raw.githubusercontent.com/milvus-io/milvus/master/scripts/standalone_embed.sh | bash
pip install pymilvus openai
from pymilvus import (
MilvusClient, DataType, Collection,
FieldSchema, CollectionSchema
)
# Connect to local Milvus
client = MilvusClient(uri="http://localhost:19530")
# Define schema — primary key + vector field + scalar metadata
schema = MilvusClient.create_schema(auto_id=False, enable_dynamic_field=True)
schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True)
schema.add_field(field_name="vector", datatype=DataType.FLOAT_VECTOR, dim=1536)
schema.add_field(field_name="text", datatype=DataType.VARCHAR, max_length=2048)
schema.add_field(field_name="category", datatype=DataType.VARCHAR, max_length=64)
schema.add_field(field_name="year", datatype=DataType.INT32)
# Create collection
client.create_collection(
collection_name="articles",
schema=schema,
consistency_level="Strong" # Strong | Bounded | Eventually
)
print(client.describe_collection("articles")) Create HNSW Index, Insert Vectors & Search
Build an HNSW index on the vector field, insert data in batches, then run filtered ANN search.
import openai
oa = openai.OpenAI()
# Build HNSW index before inserting large datasets
index_params = client.prepare_index_params()
index_params.add_index(
field_name="vector",
index_type="HNSW", # HNSW | IVF_FLAT | IVF_PQ | DiskANN | SCANN
metric_type="COSINE", # COSINE | L2 | IP
params={"M": 16, "efConstruction": 200}
)
client.create_index(collection_name="articles", index_params=index_params)
client.load_collection("articles") # load into memory for search
# Generate embeddings and insert
docs = [
{"id": 1, "text": "Milvus scales to billion vectors", "category": "db", "year": 2024},
{"id": 2, "text": "HNSW provides high recall ANN search", "category": "ai", "year": 2024},
{"id": 3, "text": "DiskANN enables disk-based billion-scale search", "category": "db","year": 2023},
]
embs = oa.embeddings.create(model="text-embedding-3-small", input=[d["text"] for d in docs])
for d, e in zip(docs, embs.data):
d["vector"] = e.embedding
client.insert(collection_name="articles", data=docs)
client.flush(collection_name="articles") # ensure data is persisted
# Filtered ANN search
query_vec = oa.embeddings.create(
model="text-embedding-3-small", input=["distributed vector search"]
).data[0].embedding
results = client.search(
collection_name="articles",
data=[query_vec],
filter='category == "db" and year >= 2024', # scalar filter
limit=3,
output_fields=["text", "category", "year"]
)
for hits in results:
for hit in hits:
print(f"score={hit['distance']:.4f} | {hit['entity']['text']}") DiskANN: Billion-Scale with Disk Storage
When your collection exceeds available RAM, DiskANN stores the index on SSD while maintaining good recall and latency.
# DiskANN index — ideal for 100M+ vectors exceeding RAM
index_params = client.prepare_index_params()
index_params.add_index(
field_name="vector",
index_type="DISKANN",
metric_type="COSINE",
params={
"search_list_size": 100, # higher = better recall, slower build
"max_degree": 56, # graph degree
"pq_code_budget_gb": 2.0, # budget for PQ codes in RAM
"build_dram_budget_gb": 32.0 # RAM for build phase
}
)
# Zilliz Cloud connection (API-compatible with PyMilvus)
cloud_client = MilvusClient(
uri="https://YOUR_CLUSTER.api.gcp-us-west1.zillizcloud.com",
token="YOUR_ZILLIZ_API_KEY"
)
# Same SDK — just change the connection URI Milvus vs Qdrant vs Weaviate vs Pinecone
| Feature | Milvus | Qdrant | Weaviate | Pinecone |
|---|---|---|---|---|
| Max scale | Billion+ | 100M+ | 100M+ | 100M+ |
| Architecture | Distributed microservices | Single binary / cluster | Single binary / cluster | Managed |
| Index types | 12+ (HNSW, DiskANN, GPU) | HNSW, Flat | HNSW | Proprietary |
| GPU support | Yes | No | No | No |
| Managed cloud | Zilliz Cloud | Qdrant Cloud | Weaviate Cloud | Yes (serverless) |
| Hybrid search | Yes (sparse+dense) | Yes (native sparse) | Yes (BM25) | Limited |
| Setup complexity | Medium (Kubernetes) | Low | Low | Minimal |
Frequently Asked Questions
What is Milvus and when should I use it?▼
Milvus is a distributed, open-source vector database built for billion-scale similarity search. It was designed from the ground up for horizontal scaling — separating storage, query, and index nodes for independent scaling. Use Milvus when you need to search across hundreds of millions to billions of vectors with low latency, have DevOps capacity to manage a cluster, or want the managed Zilliz Cloud version.
What is the difference between Milvus standalone and cluster mode?▼
Standalone mode runs all Milvus components (proxy, root coordinator, data node, query node, index node) in a single Docker container. It suits development, small teams, and collections under ~10M vectors. Cluster mode on Kubernetes separates each component for independent horizontal scaling — data nodes scale for ingestion, query nodes for search throughput. Cluster mode is required for production at billion-scale.
What index types does Milvus support?▼
Milvus supports HNSW (best recall, high memory), IVF_FLAT (inverted file index, balanced), IVF_PQ (product quantization, low memory), IVF_SQ8 (scalar quantization), SCANN (Google's optimized ANN), and DiskANN (billion-scale with disk-based storage). For most RAG use cases, HNSW is recommended. DiskANN is ideal when you have more vectors than RAM can hold.
How does Milvus schema design work?▼
A Milvus collection has a schema with typed fields. Every collection requires a primary key field (INT64 or VARCHAR) and at least one FloatVector field for embeddings. You can add any number of scalar fields (INT8, INT64, FLOAT, VARCHAR, BOOL, JSON, ARRAY) as metadata. Unlike relational databases, you define the schema once at collection creation and cannot add fields later (without migration).
What is Zilliz Cloud?▼
Zilliz Cloud is the fully managed, enterprise version of Milvus built and operated by the Milvus creators. It offers serverless and dedicated cluster tiers, automatic scaling, BYOC (Bring Your Own Cloud) for data residency, SOC 2 compliance, and a free tier with 1GB storage. It is API-compatible with Milvus SDK — you can switch from self-hosted to Zilliz Cloud by changing the connection URL.
How does Milvus compare to Qdrant for large-scale deployments?▼
Both are production-grade open-source vector databases. Milvus has more mature distributed architecture for billion-scale workloads and a wider ecosystem (Attu UI, Milvus Backup, CDC). Qdrant has simpler setup, better single-node performance, richer payload filtering, and native sparse vector support. For teams already on Kubernetes managing 100M+ vectors, Milvus is the battle-tested choice. For smaller teams wanting fast setup, Qdrant wins.
Related Products
on GumroadAI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →AI Developer Prompts Pack
55 battle-tested prompt templates for the workflows developers actually use: code review, debugging, architecture, documentation, and testing. Stop writing prompts from scratch.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
AI Hallucination Detector
Scan LLM-generated text for hallucination risk signals: fabricated citations, overconfident claims, suspect statistics, and verification gaps. Risk score 0-100 with highlighted problem spans.
Open free tool →
AI Safety Checklist Generator
Generate a customized AI safety evaluation checklist for your deployment. Covers technical safety, content moderation, security, bias, privacy, and regulatory compliance. Export to Markdown.
Open free tool →
CrewAI Agent Config Generator
Build CrewAI agent configurations visually. Define roles, goals, backstories, and tools. Generate YAML or Python code for multi-agent crews.
Open free tool →
More Free Tools
Related Articles
Vector Database Comparison 2026: Pinecone vs Weaviate vs Qdrant vs Chroma
In-depth comparison of the top vector databases in 2026. Evaluate Pinecone, Weaviate, Qdrant, and Chroma on performance, scalability, filtering, pricing, and self-hosting for production AI applications.
Vector Databases Explained: Pinecone vs Weaviate vs Qdrant vs Chroma (2026 Guide)
A complete comparison of the best vector databases in 2026: Pinecone, Weaviate, Qdrant, Chroma, and pgvector. Pricing, code examples, performance benchmarks, and a clear decision framework for AI and LLM applications.
Building a RAG Pipeline from Scratch: Embeddings, Vector Databases, and Retrieval
Step-by-step guide to building a production-ready RAG pipeline in Python. Covers embeddings, chunking strategies, Chroma and Pinecone setup, hybrid search, reranking, and evaluation with RAGAS.
Building Production RAG Systems with LlamaIndex and Vector Databases 2026
Complete guide to building production-ready RAG systems with LlamaIndex v0.10+. Covers chunking strategies, embedding models, Chroma, Pinecone, Weaviate integration, and advanced retrieval patterns.
Building a Production RAG Pipeline: Complete Implementation Guide 2026
A comprehensive guide to building production-ready RAG pipelines in 2026. Covers chunking strategies, embedding models, vector store selection, retrieval techniques, reranking, evaluation with RAGAS/TruLens, and LangChain vs LlamaIndex vs custom implementations.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →