Skip to main content

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.

✓ Billion-scale distributed search ✓ 12+ index types (HNSW, DiskANN) ✓ Standalone & cluster modes ✓ Scalar filtering ✓ Zilliz Cloud managed option
Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$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.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

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 scaleBillion+100M+100M+100M+
ArchitectureDistributed microservicesSingle binary / clusterSingle binary / clusterManaged
Index types12+ (HNSW, DiskANN, GPU)HNSW, FlatHNSWProprietary
GPU supportYesNoNoNo
Managed cloudZilliz CloudQdrant CloudWeaviate CloudYes (serverless)
Hybrid searchYes (sparse+dense)Yes (native sparse)Yes (BM25)Limited
Setup complexityMedium (Kubernetes)LowLowMinimal

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.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

AI Hallucination Detector AI Safety Checklist Generator CrewAI Agent Config Generator Embedding Storage Calculator RAG Chunk Size Optimizer AI Model Comparator Test Coverage Calculator AI Agent Memory Planner AI Model Comparison Tool Jotai Atom Explorer LLM Cost Calculator CSS Container Query Builder LLM Context Window Calculator AI Prompt Cost Calculator LLM JSON Schema Builder AI Agent Run Cost Tracker AI Pipeline DAG Builder LLM Benchmark Calculator Prompt Injection Tester LangChain PromptTemplate Builder AI Token Cost Calculator MySQL Query Explainer PostgreSQL EXPLAIN Analyzer GraphQL Fragment Generator Jest Coverage Config Generator AI Model Benchmark Comparator Cron Expression Explainer Font Pairing Preview LLM Prompt Cost Calculator AI Model Context Window Visualizer RAG Chunking Calculator OpenAI Prompt Tester AI Rate Limit Calculator LLM System Prompt Analyzer Vibe Coding Prompt Optimizer AI IDE Comparator RAG Chunking Calculator Token Counter & Cost Estimator AI Model Comparison Table LLM Prompt Template Builder AI Commit Message Generator AI Doc Generator — Pro Tool AI Regex Explainer — Pro Tool AI System Guardian Vitest Configuration Generator Mermaid Diagram Generator Elasticsearch Query Tester mTLS Certificate Chain Builder Prompt Token Estimator JS Prototype Chain Visualizer OpenAI Token Counter System Prompt Builder Token Context Calculator LLM Prompt Caching Calculator Multi-Agent Orchestration Planner AI Prompt Token Estimator OpenAI Function Calling Generator AI Context Window Visualizer AI API Rate Limit Calculator HTTP Headers Analyzer AI Code Review — Pro Tool AI Error Explainer — Pro Tool AI SQL Builder — Pro Tool AI Unit Test Generator — Pro Tool Color Palette Generator Docker Compose Generator JWT Decoder Prompt Template Builder Regex Tester RSA Key Pair Generator SMTP Server Tester Biome Config Generator Terraform Variable Validator Haproxy Config Validator SBOM Generator AI Variable Namer AI PR Description Generator AI JSDoc Generator K8s Resource Limits Calculator Regex Flags Explainer LLM Token Counter OAuth2 Flow Visualizer Jest Testing Framework Guide Vitest Guide — Vite-native Testing Playwright E2E Testing Guide Core Web Vitals Calculator Solana Program ID Generator Multi-Chain Wallet Address Validator OpenTelemetry Jaeger AI Embeddings Dimension Explorer Bezier Curve Editor OpenTelemetry Trace Builder Embedding Similarity Calculator TypeScript Discriminated Union Builder Core Web Vitals Budget Calculator JWT Decoder & Validator Blockchain Transaction Fee Calculator Database Query Cost Analyzer

Related Articles

Apr 1, 2026 · 12 min read

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.

Apr 1, 2026 · 13 min read

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.

Mar 28, 2026 · 12 min read

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.

Mar 28, 2026 · 14 min read

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.

Mar 28, 2026 · 18 min read

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.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$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.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →