[KongchangAI]
· 2 min read· 1,454 words

Milvus 2.6 in Practice: High-Performance RAG from Vector Principles to Enterprise Q&A

Milvus 2.6 in Practice: High-Performance RAG from Vector Principles to Enterprise Q&A

Outlines Milvus 2.6's vector principles, cloud-native architecture, and high-performance RAG project implementation path.

Based on Li Jin's course, this article systematically outlines the positioning, principles, and practical path of Milvus 2.6, an open-source vector database. It compares Milvus's role in the AI tech stack to MySQL in Java development, emphasizing its open-source, free, and deeply controllable advantages, and explains its relationship with Zilliz Cloud as similar to Linux and Red Hat. It then covers similarity computation and ANN retrieval, explains the capability boundaries of vector databases versus traditional relational databases. The architecture section introduces Stream, Query, Data nodes and Coordinator, along with etcd, message queues, and object storage, and provides hardware recommendations for Python lightweight and single-machine deployment. The RAG practice focuses on tiered storage, eviction policies, warm-up mechanisms, and watermark management, and finally points out that vector databases are the cornerstone for entering the AI large model field.

Vector databases are becoming the infrastructure of AI applications, and Milvus, the world's most popular open-source vector database, brings significant architectural and performance upgrades in version 2.6. Based on Li Jin's course content, this article outlines the key path from vector principles to high-performance RAG project implementation, helping developers build systematic understanding.

Why Choose Milvus 2.6: Positioning as an Open-Source Vector Database

In the AI large model tech stack, the vector database plays a role similar to MySQL in traditional Java development—it stores and retrieves high-dimensional vectors and is a core component of RAG systems. Milvus officially positions itself as the world's hottest open-source vector database, maintaining high GitHub popularity and leading community activity among similar products.

The core reasons for choosing Milvus are open-source freedom and deep controllability. Compared to commercial paid solutions, the open-source version allows developers to deeply understand underlying principles and avoid high licensing fees. Meanwhile, Milvus offers multiple deployment forms from single-machine to cloud-native, adapting to different scale scenarios.

Rather, we need to tackle

It's worth noting that the relationship between Milvus and Zilliz Cloud is similar to that between Linux and Red Hat/CentOS: Milvus is the open-source kernel, while Zilliz Cloud is a commercial cloud service built on Milvus, offering operations-free, higher-performance enterprise-grade experience. For personal learning and open-source projects, using Milvus directly is sufficient; for enterprise production environments, Zilliz Cloud's managed service can be considered.

The "specialty" of vector databases is similarity computation. Traditional relational databases excel at exact matching (e.g., WHERE id = 1) or fuzzy queries (e.g., LIKE '%keyword%'), but they are powerless when facing the need to "find a target from billions of images in milliseconds." Vector databases convert data into high-dimensional vectors and use approximate nearest neighbor (ANN) algorithms to quickly retrieve similar items in vector space.

Understanding concepts like vectorization, cosine similarity, and embedding is fundamental to building RAG systems. In the RAG workflow, documents are encoded into vectors by an embedding model and stored in Milvus; when a user asks a question, it is also encoded into a vector, and similarity retrieval finds the most relevant document fragments, which are then passed to the large model to generate an answer.

If you choose some

ANN (Approximate Nearest Neighbor) algorithms are key to vector retrieval performance. Exact nearest neighbor search requires computing the distance between the query vector and all vectors in the database one by one, with O(N) complexity, which cannot meet millisecond-level response for billion-scale data. ANN builds index structures (such as HNSW graph index, IVF inverted index, PQ product quantization, etc.) to trade a small loss in recall for orders of magnitude speedup.

Cosine similarity measures how close two vectors are in direction, ranging from -1 to 1, with larger values indicating greater similarity; it is commonly used for text embedding retrieval. Alongside it are Euclidean distance (L2) and inner product (IP). Milvus requires explicitly specifying the metric type when creating an index, and it must match the training method of the embedding model used.

Embedding refers to mapping unstructured data such as text and images into fixed-dimensional dense vectors through deep learning models, making semantically similar content closer in vector space. This is the prerequisite for vector databases to "understand semantics."

Milvus 2.6 Architecture Analysis: Cloud-Native and Layered Design

Milvus 2.6 adopts a cloud-native architecture, fully designed based on the Kubernetes ecosystem. From the official architecture diagram, the system includes multiple core components: Stream streaming nodes, Query query nodes, Data data nodes, and Coordinator. The coordinator routes requests to different nodes based on operation type, achieving load separation.

The storage layer supports etcd (commonly used for Kubernetes metadata storage), message middleware (such as Kafka, Pulsar, or new message queues like WarpStream), and object storage (Amazon S3, MinIO, or cloud storage). This design enables Milvus to smoothly scale from single-machine deployment to large-scale cloud deployment.

Then we can take a look

For beginners, the simplest way to get started is the Python lightweight version: install the client library via pip install pymilvus, start the service locally using Milvus Lite, and connect with the client. For single-machine deployment, at least 8GB of memory and an Intel second-generation Core or higher CPU are recommended, and using a solid-state drive is strongly advised—Milvus performance is significantly limited on non-SSD drives.

It uses ETCD inside

Milvus's storage-compute separation design is the core of its cloud-native capability: Query nodes handle vector retrieval computation, Data nodes handle data persistence and index building, and the two are decoupled via message queues, allowing independent scaling. etcd handles cluster metadata and coordination services (node registration, health checks, configuration distribution), message middleware (Kafka/Pulsar/WarpStream) serves as a log stream to ensure durability and ordering of data writes, and object storage (S3/MinIO) stores segment files and index files.

This combination is exactly the "log as data" architectural paradigm: writes first land in the message queue, then Data nodes consume and persist them to object storage, and Query nodes load indexes to serve queries. Milvus Lite simplifies the above components into a single-process embedded implementation, with data stored in local files. It is suitable for prototyping and learning but does not support distributed features.

RAG Project Practice: From Theory to Intelligent Q&A System

The course quickly built a RAG intelligent Q&A project based on Milvus. The focus of the practical session is not simple installation and introduction, but solving the "blue points" in the project: tiered storage, eviction policies, warm-up mechanisms, etc. These concepts frequently appear in interviews and real projects and are key to distinguishing ordinary developers from architects.

For RAG system optimization, attention should be paid to tuning points such as watermark management, warm-up sub-segments, and index strategies. Milvus 2.6's tiered storage allows separation of hot and cold data, eviction policies control which data remains in memory, and warm-up mechanisms ensure data is ready when queries hit. Proper configuration of these parameters can significantly improve retrieval performance and resource utilization.

Tiered Storage refers to Milvus dividing data by access frequency into multiple tiers: memory, local disk, and object storage. Hot data resides in memory to ensure query latency, while cold data sinks to cheap storage to control costs. Eviction Policy determines which data segments are swapped out when memory is insufficient, analogous to OS page replacement algorithms; Milvus supports policies based on access frequency and time.

Warm-up refers to proactively loading indexes of specified collections or partitions into memory before queries arrive, avoiding cold start latency on first query. Watermark marks the progress boundary of data consumption in streaming write scenarios, used to ensure query visibility and data consistency. Together, these mechanisms determine the latency stability and resource overhead of RAG systems as data volume grows.

Drawing on over 13 years of Java development and architecture experience, Li Jin points out that the AI large model field remains hot, but developers need to grasp core skill points: multi-agent systems, RAG optimization, model fine-tuning, and core algorithms. For Java developers, transitioning to AI architecture requires mastering both Java architecture capabilities and AI application development capabilities.

As AI infrastructure, vector databases are the cornerstone for entering the large model field. Mastering Milvus principles and practice not only helps handle deep interview questions but also enables implementation of high-performance RAG systems in enterprise projects. From vector principles to architecture design to project tuning, this learning path covers the core of AI architecture technology for the next one to two years.

This article is based on the public course content of Li Jin on Bilibili, combined with Milvus official documentation, for developers' learning reference.

One-line Summary

Outlines Milvus 2.6's vector principles, cloud-native architecture, and high-performance RAG project implementation path.

Paragraph Summary

Based on Li Jin's course content, this article systematically outlines the positioning, principles, and practical path of Milvus 2.6, an open-source vector database. It first compares Milvus's role in the AI tech stack to MySQL in Java development, emphasizing its open-source, free, and deeply controllable advantages, and explains its relationship with Zilliz Cloud as similar to Linux and Red Hat. Then, starting from similarity computation and ANN retrieval, it explains the capability boundaries of vector databases compared to traditional relational databases. The architecture section introduces Stream, Query, Data nodes and Coordinator, as well as the combination of etcd, message queues, and object storage, and provides hardware recommendations for the Python lightweight version and single-machine deployment. The RAG practice focuses on tuning points such as tiered storage, eviction policies, warm-up mechanisms, and watermark management, and finally, combined with job market trends, points out that vector databases are the cornerstone for entering the AI large model field.

#Milvus 2.6#vector database#RAG#ANN#tiered storage#embedding
Share:

Related articles