# milvus-io/milvus architecture

> Architecture diagram of the GitHub repository milvus-io/milvus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/milvus-io/milvus
- Repository: https://github.com/milvus-io/milvus

## Overview

Milvus is a distributed vector database for storing and searching vector and scalar data. The principal workflow is to define a collection, insert data, then issue vector or hybrid searches and receive ranked results. The README documents these user-facing capabilities and the separation of compute and storage; source excerpts show proxy/query reduction and WAL recovery internals. Several service-to-service links are therefore shown as unverified rather than asserted as inspected call paths.

Main entry points: [`internal/proxy`](https://github.com/milvus-io/milvus/tree/master/internal/proxy) (Proxy API), [`internal/querynodev2`](https://github.com/milvus-io/milvus/tree/master/internal/querynodev2) (Query node), [`client/milvusclient`](https://github.com/milvus-io/milvus/tree/master/client/milvusclient) (Go client SDK), [`internal/core/src/segcore/SegmentSealed.h`](https://github.com/milvus-io/milvus/blob/master/internal/core/src/segcore/SegmentSealed.h) (Sealed segments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Client and API"]
  node_sdk["Go client SDK"]
  node_entry["Server entry<br/>[run.go]"]
  node_proxy["Proxy API"]
end

subgraph group_coord["Cluster Coordination"]
  node_rootcoord["Root coordinator"]
  node_datacoord["Data coordinator"]
  node_querycoord["Query coordinator"]
  node_streamcoord["Streaming coordinator"]
end

subgraph group_write["Ingestion and Storage"]
  node_datanode["Data node<br/>[data_node.go]"]
  node_wal["WAL recovery"]
  node_serializer["Storage serializer"]
  node_storage[("Object storage")]
end

subgraph group_query["Query and Search"]
  node_querynode["Query node"]
  node_searchpipe["Search pipeline<br/>[search_pipeline.go]"]
  node_querypipe["Query reduction<br/>[query_pipeline.go]"]
end

subgraph group_engine["Core Search Engine"]
  node_segment["Sealed segments<br/>[SegmentSealed.h]"]
  node_index["Index engine<br/>[Index.h]"]
  node_schema["Schema and types<br/>[Schema.h]"]
end

node_user(("Application developer"))

node_user -->|"configures and writes"| node_sdk
node_user -->|"searches"| node_sdk
node_sdk -.->|"connects to"| node_entry
node_entry -.->|"routes requests"| node_proxy
node_proxy -.->|"requests metadata"| node_rootcoord
node_proxy -.->|"requests data services"| node_datacoord
node_proxy -.->|"requests query services"| node_querycoord
node_proxy -->|"builds search"| node_searchpipe
node_proxy -->|"builds reduction"| node_querypipe
node_searchpipe -.->|"dispatches searches"| node_querynode
node_querynode -.->|"queries segments"| node_segment
node_querynode -.->|"reduces results"| node_querypipe
node_datacoord -.->|"assigns ingestion"| node_datanode
node_streamcoord -.->|"coordinates streams"| node_wal
node_wal -.->|"persists data"| node_serializer
node_serializer -.->|"writes files"| node_storage
node_segment -->|"loads indexes"| node_index
node_schema -.->|"defines fields"| node_segment

click node_sdk "https://github.com/milvus-io/milvus/tree/master/client/milvusclient"
click node_entry "https://github.com/milvus-io/milvus/blob/master/cmd/milvus/run.go"
click node_proxy "https://github.com/milvus-io/milvus/tree/master/internal/proxy"
click node_rootcoord "https://github.com/milvus-io/milvus/tree/master/internal/rootcoord"
click node_datacoord "https://github.com/milvus-io/milvus/tree/master/internal/datacoord"
click node_querycoord "https://github.com/milvus-io/milvus/tree/master/internal/querycoordv2"
click node_streamcoord "https://github.com/milvus-io/milvus/tree/master/internal/streamingcoord"
click node_datanode "https://github.com/milvus-io/milvus/blob/master/cmd/components/data_node.go"
click node_wal "https://github.com/milvus-io/milvus/blob/master/internal/streamingnode/server/wal/recovery/recovery_storage_impl.go"
click node_serializer "https://github.com/milvus-io/milvus/blob/master/internal/flushcommon/syncmgr/storage_serializer.go"
click node_storage "https://github.com/milvus-io/milvus/tree/master/internal/storage"
click node_querynode "https://github.com/milvus-io/milvus/tree/master/internal/querynodev2"
click node_searchpipe "https://github.com/milvus-io/milvus/blob/master/internal/proxy/dql/search_pipeline.go"
click node_querypipe "https://github.com/milvus-io/milvus/blob/master/internal/proxy/dql/query_pipeline.go"
click node_segment "https://github.com/milvus-io/milvus/blob/master/internal/core/src/segcore/SegmentSealed.h"
click node_index "https://github.com/milvus-io/milvus/blob/master/internal/core/src/index/Index.h"
click node_schema "https://github.com/milvus-io/milvus/blob/master/internal/core/src/common/Schema.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sdk,node_entry,node_proxy toneBlue
class node_rootcoord,node_datacoord,node_querycoord,node_streamcoord toneAmber
class node_datanode,node_wal,node_serializer,node_storage toneMint
class node_querynode,node_searchpipe,node_querypipe toneRose
class node_segment,node_index,node_schema,node_user toneIndigo
```

## Components

### Client and API

- [Go client SDK](https://github.com/milvus-io/milvus/tree/master/client/milvusclient): `client/milvusclient`
- [Server entry](https://github.com/milvus-io/milvus/blob/master/cmd/milvus/run.go): `cmd/milvus/run.go`
- [Proxy API](https://github.com/milvus-io/milvus/tree/master/internal/proxy): `internal/proxy`

### Cluster Coordination

- [Root coordinator](https://github.com/milvus-io/milvus/tree/master/internal/rootcoord): `internal/rootcoord`
- [Data coordinator](https://github.com/milvus-io/milvus/tree/master/internal/datacoord): `internal/datacoord`
- [Query coordinator](https://github.com/milvus-io/milvus/tree/master/internal/querycoordv2): `internal/querycoordv2`
- [Streaming coordinator](https://github.com/milvus-io/milvus/tree/master/internal/streamingcoord): `internal/streamingcoord`

### Ingestion and Storage

- [Data node](https://github.com/milvus-io/milvus/blob/master/cmd/components/data_node.go): `cmd/components/data_node.go`
- [WAL recovery](https://github.com/milvus-io/milvus/blob/master/internal/streamingnode/server/wal/recovery/recovery_storage_impl.go): `internal/streamingnode/server/wal/recovery/recovery_storage_impl.go`
- [Storage serializer](https://github.com/milvus-io/milvus/blob/master/internal/flushcommon/syncmgr/storage_serializer.go): `internal/flushcommon/syncmgr/storage_serializer.go`
- [Object storage](https://github.com/milvus-io/milvus/tree/master/internal/storage): `internal/storage`

### Query and Search

- [Query node](https://github.com/milvus-io/milvus/tree/master/internal/querynodev2): `internal/querynodev2`
- [Search pipeline](https://github.com/milvus-io/milvus/blob/master/internal/proxy/dql/search_pipeline.go): `internal/proxy/dql/search_pipeline.go`
- [Query reduction](https://github.com/milvus-io/milvus/blob/master/internal/proxy/dql/query_pipeline.go): `internal/proxy/dql/query_pipeline.go`

### Core Search Engine

- [Sealed segments](https://github.com/milvus-io/milvus/blob/master/internal/core/src/segcore/SegmentSealed.h): `internal/core/src/segcore/SegmentSealed.h`
- [Index engine](https://github.com/milvus-io/milvus/blob/master/internal/core/src/index/Index.h): `internal/core/src/index/Index.h`
- [Schema and types](https://github.com/milvus-io/milvus/blob/master/internal/core/src/common/Schema.h): `internal/core/src/common/Schema.h`

### Other components

- **Application developer**

## Connections

- Application developer → Go client SDK: configures and writes
- Application developer → Go client SDK: searches
- Go client SDK → Server entry: connects to
- Server entry → Proxy API: routes requests
- Proxy API → Root coordinator: requests metadata
- Proxy API → Data coordinator: requests data services
- Proxy API → Query coordinator: requests query services
- Proxy API → Search pipeline: builds search (evidence: `internal/proxy/dql/search_pipeline.go`)
- Proxy API → Query reduction: builds reduction (evidence: `internal/proxy/dql/query_pipeline.go`)
- Search pipeline → Query node: dispatches searches
- Query node → Sealed segments: queries segments
- Query node → Query reduction: reduces results
- Data coordinator → Data node: assigns ingestion
- Streaming coordinator → WAL recovery: coordinates streams
- WAL recovery → Storage serializer: persists data
- Storage serializer → Object storage: writes files (evidence: `internal/flushcommon/syncmgr/storage_serializer.go`)
- Sealed segments → Index engine: loads indexes (evidence: `internal/core/src/segcore/SegmentSealed.h`)
- Schema and types → Sealed segments: defines fields
