ベクトルDB比較2025:Qdrant vs Milvus vs Weaviate で類似検索を構築する
オープンソースラボ編集部 ・ 2026年6月14日
ベクトルDB比較2025:Qdrant vs Milvus vs Weaviate で類似検索を構築する
🔎 RAG・意味検索・レコメンドエンジンに必須のベクトルデータベース。2025年最新版でQdrant・Milvus・Weaviateを徹底比較します。
ベクトルDBとは
テキスト・画像・音声をEmbeddingした高次元ベクトルを保存し、コサイン類似度・ユークリッド距離等で類似検索(ANN: Approximate Nearest Neighbor)を行うデータベースです。
主要ツール比較表
| 項目 | Qdrant | Milvus | Weaviate |
|---|---|---|---|
| ライセンス | Apache 2.0 | Apache 2.0 | BSD 3-Clause |
| 言語 | Rust | Go/C++ | Go |
| インメモリ | ◎ | ◎ | ◎ |
| ディスク対応 | ◎(Memmap) | ◎(MMap) | ◎ |
| フィルタリング | ◎ | ◎ | ◎ |
| スパースベクトル | ◎(SPLADE) | ◎ | ○ |
| マルチモーダル | ○ | ○ | ◎ |
| スケールアウト | ◎ | ◎ | ◎ |
| Managed SaaS | Qdrant Cloud | Zilliz Cloud | Weaviate Cloud |
各ツールの特徴
Qdrant
Rustで書かれた高速・高精度なベクトル検索エンジン。フィルタリング精度とパフォーマンスのバランスが最も優れています。
主な特徴:
- ペイロードフィルタリング(メタデータで絞り込み)が高速
- スパースベクトル(SPLADE)とデンスベクトルのハイブリッド検索
- 量子化(スカラー・積)でメモリ削減
- Rust製で低メモリ・低CPU消費
from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct
client = QdrantClient(url="http://localhost:6333")
# コレクション作成
client.create_collection(
collection_name="my_docs",
vectors_config=VectorParams(size=1536, distance=Distance.COSINE),
)
# ベクトル挿入
client.upsert(
collection_name="my_docs",
points=[
PointStruct(
id=1,
vector=[0.1, 0.2, ...], # 1536次元ベクトル
payload={"title": "Python入門", "category": "programming"}
),
]
)
# 類似検索(メタデータフィルタ付き)
results = client.search(
collection_name="my_docs",
query_vector=[0.1, 0.2, ...],
query_filter={"must": [{"key": "category", "match": {"value": "programming"}}]},
limit=5,
)
向いているケース: RAG・類似検索・フィルタリング重視
Milvus
Zilliz社が開発した、大規模ベクトル検索のためのOSSデータベース。数十億規模のベクトルを扱う超大規模ユースケースで実績があります。
主な特徴:
- IVF_FLAT・HNSW・IVF_PQ等の豊富なインデックスタイプ
- ストリーミング(Kafka/Pulsar)との統合
- GPU加速サポート
- 数十億ベクトルの本番実績(Alibaba等)
from pymilvus import connections, FieldSchema, CollectionSchema, DataType, Collection
# 接続
connections.connect(host='localhost', port='19530')
# スキーマ定義
fields = [
FieldSchema(name="id", dtype=DataType.INT64, is_primary=True),
FieldSchema(name="embedding", dtype=DataType.FLOAT_VECTOR, dim=1536),
FieldSchema(name="text", dtype=DataType.VARCHAR, max_length=2000),
]
schema = CollectionSchema(fields, description="Document collection")
collection = Collection("my_docs", schema)
# インデックス作成
index_params = {"index_type": "HNSW", "metric_type": "COSINE", "params": {"M": 16, "efConstruction": 200}}
collection.create_index("embedding", index_params)
# 検索
collection.load()
results = collection.search(
data=[[0.1, 0.2, ...]],
anns_field="embedding",
param={"metric_type": "COSINE", "params": {"ef": 100}},
limit=5,
output_fields=["text"]
)
向いているケース: 超大規模(10億件以上)・GPU利用・エンタープライズ
Weaviate
GraphQL APIとマルチモーダル検索を特徴とするベクトルDB。テキスト・画像・音声をネイティブに処理できます。
主な特徴:
- ビルトインEmbeddingモジュール(OpenAI/Cohere/Hugging Face等と直接統合)
- GraphQL APIでシンプルなクエリ
- マルチモーダル(テキスト+画像の同時検索)
- Generative Search(検索+LLM生成を1クエリで)
import weaviate
import weaviate.classes as wvc
client = weaviate.connect_to_local()
# コレクション作成(自動Embedding付き)
client.collections.create(
"Article",
vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_openai(),
generative_config=wvc.config.Configure.Generative.openai(),
properties=[
wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT),
wvc.config.Property(name="content", data_type=wvc.config.DataType.TEXT),
]
)
articles = client.collections.get("Article")
# データ挿入(Embeddingは自動生成)
articles.data.insert({"title": "Python入門", "content": "Pythonは..."})
# ハイブリッド検索(ベクトル+キーワード)
results = articles.query.hybrid(
query="Python プログラミング 入門",
limit=5,
)
client.close()
向いているケース: マルチモーダル・Generative Search・GraphQL API
選択ガイド
| 状況 | 推奨 |
|---|---|
| フィルタリング重視・パフォーマンス | Qdrant |
| 超大規模(10億件以上)・GPU | Milvus |
| マルチモーダル・Generative Search | Weaviate |
内部リンク
外部リソース
FAQ
Q. pgvector(PostgreSQL拡張)との違いは何ですか?
pgvectorは既存のPostgreSQLにベクトル検索を追加します。数百万件までなら十分ですが、それ以上の規模や高度なANNアルゴリズムが必要な場合は専用のベクトルDBを検討してください。
Q. Qdrant・Milvus・Weaviateはローカルで動かせますか?
3ツールともDockerで1コマンドで起動できます。本番はクラスタモード、開発はシングルノードというように使い分けできます。
Q. ハイブリッド検索とは何ですか?
ベクトル検索(意味的類似度)とキーワード検索(BM25等)を組み合わせて、どちらか一方では見つけられない結果を補完するテクニックです。
Q. Embeddingモデルはどれを使うべきですか?
日本語の場合はtext-embedding-3-small(OpenAI)やintfloat/multilingual-e5-largeが精度が高いです。コストを抑えたい場合はローカルモデルも選択肢です。