SlideShare a Scribd company logo
1 | © Copyright 8/16/23 Zilliz
1 | © Copyright 8/16/23 Zilliz
Stephen Batifol | Zilliz
MLOps.community, Zilliz Summit
Keeping Data Fresh: Mastering
Updates in Vector Databases
2 | © Copyright 8/16/23 Zilliz
2 | © Copyright 8/16/23 Zilliz
Stephen Batifol
Developer Advocate, Zilliz
stephen.batifol@zilliz.com
https://www.linkedin.com/in/stephen-batifol/
https://twitter.com/stephenbtl
Speaker
3 | © Copyright 8/16/23 Zilliz
3 | © Copyright 8/16/23 Zilliz
27K
GitHub
Stars
25M
Downloads
250
Contributors
2,600
+
Forks
Milvus is an open-source vector database for GenAI projects. pip install on your
laptop, plug into popular AI dev tools, and push to production with a single line of
code.
Easy Setup
pip install to
start coding in a
notebook within
seconds.
Reusable Code
Write once, and
deploy with one line
of code into the
production
environment
Integration
Plug into OpenAI,
Langchain,
LlmaIndex, and
many more
Feature-rich
Dense & sparse
embeddings,
filtering, reranking
and beyond
4 | © Copyright 8/16/23 Zilliz
4 | © Copyright 8/16/23 Zilliz
Milvus Lite
pip install pymilvus
5 | © Copyright 8/16/23 Zilliz
5 | © Copyright 8/16/23 Zilliz
Seamless integration with all popular AI toolkits
6 | © Copyright 8/16/23 Zilliz
6 | © Copyright 8/16/23 Zilliz
Zilliz Cloud is a fully-managed vector
database built atop of OSS Milvus
Open Source
Flexible & Secure Deployment
Enterprise features
for production-ready
Cardinal Search Engine &
Use Case Optimized Compute
Milvus completely
re-engineered to
be optimized
Pipelines Connectors Model Library
A streamlined
unstructured data
platform
Stable Milvus versions
are continuously
deployed to Zilliz Cloud
7 | © Copyright 8/16/23 Zilliz
7 | © Copyright 8/16/23 Zilliz
| © Copyright 8/16/23 Zilliz
7
RAG
Retrieval Augmented Generation)
8 | © Copyright 8/16/23 Zilliz
8 | © Copyright 8/16/23 Zilliz
Basic Idea
Use RAG to force the LLM to work with your data
by injecting it via a vector database like Milvus
9 | © Copyright 8/16/23 Zilliz
9 | © Copyright 8/16/23 Zilliz
Basic RAG Architecture
10 | © Copyright 8/16/23 Zilliz
10 | © Copyright 8/16/23 Zilliz
Why Even Use a Vector DB?
Beyond High-Performance Search
• CRUD Operations: Just like traditional databases, vector
databases allow you to Create, Read, Update, and Delete data.
• Data Freshness: Vector databases ensure your data remains
up-to-date, reflecting the latest information for accurate searches.
• Persistence: Your data is securely stored and persists even if the
system restarts.
• Availability: Your data is readily accessible for search and retrieval
operations.
• Scalability: Vector databases can handle growing data volumes
efficiently.
11 | © Copyright 8/16/23 Zilliz
11 | © Copyright 8/16/23 Zilliz
Complete Data Management
• Data Management: Vector databases provide tools to manage
your data effectively, including data ingestion, indexing, and
querying.
• Backup and Migration: Create backups of your data for disaster
recovery and easily migrate your data between different systems.
Why Even Use a Vector DB?
12 | © Copyright 8/16/23 Zilliz
12 | © Copyright 8/16/23 Zilliz
Operational ease
• Cloud or On-Premise Deployment: Vector databases can be
deployed easily on various platforms, including cloud and
on-premise environments.
• Observability: Monitor the health and performance of your vector
database to ensure optimal operation.
• Multi-tenancy: Support multiple users or applications accessing
the same database instance securely.
Why Even Use a Vector DB?
13 | © Copyright 8/16/23 Zilliz
13 | © Copyright 8/16/23 Zilliz
Database + Vector Plugin?
• Limited functionality - Filtering, Hybrid search, Range
search
• Scalability concerns - sharing vector data has its unique
challenge
• And LLM is evolving fast, itʼs hard to catch up!
14 | © Copyright 8/16/23 Zilliz
14 | © Copyright 8/16/23 Zilliz
Design Principles
• Disaggregate storage and computation
• Fully depends on mature storage
systems
• Micro Service - scale by functionality
• Separate Streaming and historical data
• Pluggable engine, storage and index
• Log As data
15 | © Copyright 8/16/23 Zilliz
15 | © Copyright 8/16/23 Zilliz
Meta Storage
Root Query Data Index
Coordinator Service
Proxy
Proxy
etcd
Log Broker
SDK
Load Balancer
DDL/DCL
DML
NOTIFICATION
CONTROL SIGNAL
Object Storage
Minio / S3 / AzureBlob
Log Snapshot Delta File Index File
Worker Node QUERY DATA DATA
Message Storage
VECTOR
DATABASE
Access Layer
Query Node Data Node Index Node
Milvus Architecture
16 | © Copyright 8/16/23 Zilliz
16 | © Copyright 8/16/23 Zilliz
Entity
17 | © Copyright 8/16/23 Zilliz
17 | © Copyright 8/16/23 Zilliz
Each shard is managed by a supervisor
(shard leader). This supervisor is
responsible for:
• Adding new information to the shard.
• Regularly storing the data in a safe
place (object storage).
• Serving the latest information for
search requests.
• Forwarding historical data requests to
other cabinets (query nodes) if
needed.
Milvus Data Layout - Shard
18 | © Copyright 8/16/23 Zilliz
18 | © Copyright 8/16/23 Zilliz
Growing Segment:
• In-memory segment replaying data
from the Log Broker.
• Uses a FLAT index to ensure data is
fresh and appendable.
Sealed Segment:
• Immutable segment using
alternative indexing methods for
efficiency.
Milvus Data Layout - Segments
19 | © Copyright 8/16/23 Zilliz
19 | © Copyright 8/16/23 Zilliz
Behind the Scenes: How Data Gets Added and
Accessed
• Sharding: Large datasets are
divided into smaller,
manageable sections called
shards. Each shard is handled
by a dedicated datanode.
• Write-Ahead Log WAL:
When you add new data, a
proxy service writes it to a
temporary log called a WAL
(e.g., Kafka, Pulsar). Think of
it as a to-do list for the
datanodes.
20 | © Copyright 8/16/23 Zilliz
20 | © Copyright 8/16/23 Zilliz
Behind the Scenes: How Data Gets Added and
Accessed
• Datanodes subscribe to the WAL
and:
• Add new data to their assigned shard.
• Remove outdated data (if needed)
• Flush accumulated data to permanent
storage.
• Query Nodes also subscribe to the
WAL but focus on:
• Creating and managing Segments
within each shard for fast searching.
• Ensuring searches access the latest
information.
21 | © Copyright 8/16/23 Zilliz
21 | © Copyright 8/16/23 Zilliz
Index Building
To avoid frequent index building
for data updates.
A collection in Milvus is divided
further into segments, each with
its own index.
22 | © Copyright 8/16/23 Zilliz
22 | © Copyright 8/16/23 Zilliz
Data query refers to:
• Searching a specified
collection for k number of
vectors nearest to a target
vector or for all vectors within
a specified distance range to
the vector.
Data query
23 | © Copyright 8/16/23 Zilliz
23 | © Copyright 8/16/23 Zilliz
| © Copyright 8/16/23 Zilliz
23
Handling Data Updates in Milvus
24 | © Copyright 8/16/23 Zilliz
24 | © Copyright 8/16/23 Zilliz
Things to avoid!
• Auto increment Primary Keys
• Auto Generated IDs based on something you
donʼt know
25 | © Copyright 8/16/23 Zilliz
25 | © Copyright 8/16/23 Zilliz
Identifier Strategies
Unique Identifiers
• Ensure each piece of data (e.g., documents, images, or vectors) has a
unique identifier.
Example: Assign UUIDs to each document or vector for precise
identification and retrieval.
Metadata Tagging
• Attach metadata to each data item to facilitate quick searches and
categorization.
Example: Add tags such as date_created, author, and content_type
to documents.
For instance, a document might have metadata: {"id": "12345",
"date_created": "2024-06-06", "author": "John Doe",
"content_type": "research_paper"}
26 | © Copyright 8/16/23 Zilliz
26 | © Copyright 8/16/23 Zilliz
Composite Identifiers
• Combine multiple fields to create a unique identifier.
Example: Combine user_id and timestamp to create unique IDs for
user-generated content. E.g. {"id": "user123_20240606T123000"}
Hierarchical IDs
• Use hierarchical structures for complex data sets.
Example: For a hierarchical document system, use IDs like {"id":
"projectA_chapter1_section2"}
Identifier Strategies
27 | © Copyright 8/16/23 Zilliz
27 | © Copyright 8/16/23 Zilliz
Update Process with Pymilvus
28 | © Copyright 8/16/23 Zilliz
28 | © Copyright 8/16/23 Zilliz
Update Process in a Partition
29 | © Copyright 8/16/23 Zilliz
29 | © Copyright 8/16/23 Zilliz
Upsert Entities with
Langchain
30 | © Copyright 8/16/23 Zilliz
30 | © Copyright 8/16/23 Zilliz
A Detailed Look
1. Identify the Data Needing an Update
a. Prepares the updated content along with the primary key of
the document.
2. Data Transmission to the Proxy
a. The application sends an upsert request to the Milvus client
SDK.
b. The SDK transmits the request (containing updated data and
primary key) to the Proxy service.
3. Proxy communicates with Data Coordinator
a. Data Node checks PK
4. Upserts
a. Update or add new document to the collection
31 | © Copyright 8/16/23 Zilliz
31 | © Copyright 8/16/23 Zilliz
A Detailed Look (next)
5. Data Allocation and Indexing
a. Data is in the Growing Segment
6. Datanode assigned to the Segment receives the
updated data
a. Datanode creates a sequence number for the data and stores
it
b. Data accumulates within the growing segment until a certain
condition ⇒ Flush the segment.
7. Flush
a. Growing Segment ⇒ Sealed Segment
b. Write the data to a permanent storage S3, etc)
c. Ensures data persistence and avoids data loss.
8. Re-Indexing
a. Milvus triggers re-indexing for the upserted Data
32 | © Copyright 8/16/23 Zilliz
32 | © Copyright 8/16/23 Zilliz
milvus.io
github.com/milvus-io/
@milvusio
@stephenbtl
/in/stephen-batifol
Connect with me!
Thank you!

More Related Content

PDF
Scaling Vector Search: How Milvus Handles Billions+
PDF
NYCMeetup07-25-2024-Unstructured Data Processing From Cloud to Edge
PDF
09-19-2024 AI Camp Hybrid Seach - Milvus for Vector Database
PDF
09-25-2024 NJX Venture Summit Introduction to Unstructured Data
PDF
Milvus: Scaling Vector Data Solutions for Gen AI
PDF
01-Oct-2024_PES-VectorDatabasesAndAI.pdf
PDF
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
PDF
06-18-2024-Princeton Meetup-Introduction to Milvus
Scaling Vector Search: How Milvus Handles Billions+
NYCMeetup07-25-2024-Unstructured Data Processing From Cloud to Edge
09-19-2024 AI Camp Hybrid Seach - Milvus for Vector Database
09-25-2024 NJX Venture Summit Introduction to Unstructured Data
Milvus: Scaling Vector Data Solutions for Gen AI
01-Oct-2024_PES-VectorDatabasesAndAI.pdf
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
06-18-2024-Princeton Meetup-Introduction to Milvus

Similar to Keeping Data Fresh: Mastering Updates in Vector Databases (20)

PDF
09-26-2024 Conf 42 Kube Native: Unleashing the Potential of Cloud Native Open...
PDF
10-25-2024_BITS_NYC_Unstructured Data and LLM_ What, Why and How
PDF
From Dev to Prod, Vector Database Made Easy
PDF
Vector Search at Scale - Pro Tips - Stephen Batifol
PDF
2025-02-24 - AWS meetup - Zilliz presentation.pdf
PDF
Supercharge Spark: Unleashing Big Data Potential with Milvus for RAG systems
PDF
Open Source Milvus Vector Database v 2.6
PDF
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
PDF
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
PDF
20241108 - Milvus : a cloud native vector database for next generation AI app...
PDF
09-12-2024 - Milvus, Vector database used for Sensor Data RAG
PDF
09-03-2024_UnstructuredDataAndAIDiscussion.pdf
PDF
Vector Databases 101 - An introduction to the world of Vector Databases
PDF
VectorDB Schema Design 101 - Considerations for Building a Scalable and Perfo...
PDF
2024-OCT-23 NYC Meetup - Unstructured Data Meetup - Unstructured Halloween
PDF
Unstructured Data Processing from Cloud to Edge Webinar
PDF
Unstructured Data Processing from Cloud to Edge Webinar
PDF
2024 Nov 05 - Linux Foundation TAC TALK With Milvus
PDF
09-18-2024 NYC Meetup Vector Databases 102
PDF
Introducing Milvus and new features in 2.4 release
09-26-2024 Conf 42 Kube Native: Unleashing the Potential of Cloud Native Open...
10-25-2024_BITS_NYC_Unstructured Data and LLM_ What, Why and How
From Dev to Prod, Vector Database Made Easy
Vector Search at Scale - Pro Tips - Stephen Batifol
2025-02-24 - AWS meetup - Zilliz presentation.pdf
Supercharge Spark: Unleashing Big Data Potential with Milvus for RAG systems
Open Source Milvus Vector Database v 2.6
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
20241108 - Milvus : a cloud native vector database for next generation AI app...
09-12-2024 - Milvus, Vector database used for Sensor Data RAG
09-03-2024_UnstructuredDataAndAIDiscussion.pdf
Vector Databases 101 - An introduction to the world of Vector Databases
VectorDB Schema Design 101 - Considerations for Building a Scalable and Perfo...
2024-OCT-23 NYC Meetup - Unstructured Data Meetup - Unstructured Halloween
Unstructured Data Processing from Cloud to Edge Webinar
Unstructured Data Processing from Cloud to Edge Webinar
2024 Nov 05 - Linux Foundation TAC TALK With Milvus
09-18-2024 NYC Meetup Vector Databases 102
Introducing Milvus and new features in 2.4 release
Ad

More from Zilliz (20)

PDF
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
PDF
Zilliz Cloud Demo for performance and scale
PDF
Zilliz Cloud Monthly Technical Review: May 2025
PDF
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
PDF
Hands-on Tutorial: Building an Agent to Reason about Private Data with OpenAI...
PDF
Agentic AI in Action: Real-Time Vision, Memory & Autonomy with Browser Use & ...
PDF
Webinar - Zilliz Cloud Monthly Demo - March 2025
PDF
What Makes "Deep Research"? A Dive into AI Agents
PDF
Combining Lexical and Semantic Search with Milvus 2.5
PDF
Bedrock Data Automation (Preview): Simplifying Unstructured Data Processing
PDF
Deploying a Multimodal RAG System Using Open Source Milvus, LlamaIndex, and vLLM
PDF
February Product Demo: Discover the Power of Zilliz Cloud
PDF
Full Text Search with Milvus 2.5 - UD Meetup Berlin Jan 23
PDF
Building the Next-Gen Apps with Multimodal Retrieval using Twelve Labs & Milvus
PDF
Voice-to-Value- LLM-Powered Customer Interaction Analysis.pdf
PDF
Accelerate AI Agents with Multimodal RAG powered by Friendli Endpoints and Mi...
PDF
1 Table = 1000 Words? Foundation Models for Tabular Data
PDF
How Milvus allows you to run Full Text Search
PDF
How to Optimize Your Embedding Model Selection and Development through TDA Cl...
PDF
GraphRAG Agents with Neo4j, Milvus and GPT4
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz Cloud Demo for performance and scale
Zilliz Cloud Monthly Technical Review: May 2025
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Hands-on Tutorial: Building an Agent to Reason about Private Data with OpenAI...
Agentic AI in Action: Real-Time Vision, Memory & Autonomy with Browser Use & ...
Webinar - Zilliz Cloud Monthly Demo - March 2025
What Makes "Deep Research"? A Dive into AI Agents
Combining Lexical and Semantic Search with Milvus 2.5
Bedrock Data Automation (Preview): Simplifying Unstructured Data Processing
Deploying a Multimodal RAG System Using Open Source Milvus, LlamaIndex, and vLLM
February Product Demo: Discover the Power of Zilliz Cloud
Full Text Search with Milvus 2.5 - UD Meetup Berlin Jan 23
Building the Next-Gen Apps with Multimodal Retrieval using Twelve Labs & Milvus
Voice-to-Value- LLM-Powered Customer Interaction Analysis.pdf
Accelerate AI Agents with Multimodal RAG powered by Friendli Endpoints and Mi...
1 Table = 1000 Words? Foundation Models for Tabular Data
How Milvus allows you to run Full Text Search
How to Optimize Your Embedding Model Selection and Development through TDA Cl...
GraphRAG Agents with Neo4j, Milvus and GPT4
Ad

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Approach and Philosophy of On baking technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
KodekX | Application Modernization Development
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
cuic standard and advanced reporting.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Machine learning based COVID-19 study performance prediction
PPT
Teaching material agriculture food technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars
Building Integrated photovoltaic BIPV_UPV.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Approach and Philosophy of On baking technology
Spectral efficient network and resource selection model in 5G networks
KodekX | Application Modernization Development
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Weekly Chronicles - August'25 Week I
cuic standard and advanced reporting.pdf
Understanding_Digital_Forensics_Presentation.pptx
Spectroscopy.pptx food analysis technology
Review of recent advances in non-invasive hemoglobin estimation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
Programs and apps: productivity, graphics, security and other tools
MIND Revenue Release Quarter 2 2025 Press Release
Machine learning based COVID-19 study performance prediction
Teaching material agriculture food technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

Keeping Data Fresh: Mastering Updates in Vector Databases

  • 1. 1 | © Copyright 8/16/23 Zilliz 1 | © Copyright 8/16/23 Zilliz Stephen Batifol | Zilliz MLOps.community, Zilliz Summit Keeping Data Fresh: Mastering Updates in Vector Databases
  • 2. 2 | © Copyright 8/16/23 Zilliz 2 | © Copyright 8/16/23 Zilliz Stephen Batifol Developer Advocate, Zilliz stephen.batifol@zilliz.com https://www.linkedin.com/in/stephen-batifol/ https://twitter.com/stephenbtl Speaker
  • 3. 3 | © Copyright 8/16/23 Zilliz 3 | © Copyright 8/16/23 Zilliz 27K GitHub Stars 25M Downloads 250 Contributors 2,600 + Forks Milvus is an open-source vector database for GenAI projects. pip install on your laptop, plug into popular AI dev tools, and push to production with a single line of code. Easy Setup pip install to start coding in a notebook within seconds. Reusable Code Write once, and deploy with one line of code into the production environment Integration Plug into OpenAI, Langchain, LlmaIndex, and many more Feature-rich Dense & sparse embeddings, filtering, reranking and beyond
  • 4. 4 | © Copyright 8/16/23 Zilliz 4 | © Copyright 8/16/23 Zilliz Milvus Lite pip install pymilvus
  • 5. 5 | © Copyright 8/16/23 Zilliz 5 | © Copyright 8/16/23 Zilliz Seamless integration with all popular AI toolkits
  • 6. 6 | © Copyright 8/16/23 Zilliz 6 | © Copyright 8/16/23 Zilliz Zilliz Cloud is a fully-managed vector database built atop of OSS Milvus Open Source Flexible & Secure Deployment Enterprise features for production-ready Cardinal Search Engine & Use Case Optimized Compute Milvus completely re-engineered to be optimized Pipelines Connectors Model Library A streamlined unstructured data platform Stable Milvus versions are continuously deployed to Zilliz Cloud
  • 7. 7 | © Copyright 8/16/23 Zilliz 7 | © Copyright 8/16/23 Zilliz | © Copyright 8/16/23 Zilliz 7 RAG Retrieval Augmented Generation)
  • 8. 8 | © Copyright 8/16/23 Zilliz 8 | © Copyright 8/16/23 Zilliz Basic Idea Use RAG to force the LLM to work with your data by injecting it via a vector database like Milvus
  • 9. 9 | © Copyright 8/16/23 Zilliz 9 | © Copyright 8/16/23 Zilliz Basic RAG Architecture
  • 10. 10 | © Copyright 8/16/23 Zilliz 10 | © Copyright 8/16/23 Zilliz Why Even Use a Vector DB? Beyond High-Performance Search • CRUD Operations: Just like traditional databases, vector databases allow you to Create, Read, Update, and Delete data. • Data Freshness: Vector databases ensure your data remains up-to-date, reflecting the latest information for accurate searches. • Persistence: Your data is securely stored and persists even if the system restarts. • Availability: Your data is readily accessible for search and retrieval operations. • Scalability: Vector databases can handle growing data volumes efficiently.
  • 11. 11 | © Copyright 8/16/23 Zilliz 11 | © Copyright 8/16/23 Zilliz Complete Data Management • Data Management: Vector databases provide tools to manage your data effectively, including data ingestion, indexing, and querying. • Backup and Migration: Create backups of your data for disaster recovery and easily migrate your data between different systems. Why Even Use a Vector DB?
  • 12. 12 | © Copyright 8/16/23 Zilliz 12 | © Copyright 8/16/23 Zilliz Operational ease • Cloud or On-Premise Deployment: Vector databases can be deployed easily on various platforms, including cloud and on-premise environments. • Observability: Monitor the health and performance of your vector database to ensure optimal operation. • Multi-tenancy: Support multiple users or applications accessing the same database instance securely. Why Even Use a Vector DB?
  • 13. 13 | © Copyright 8/16/23 Zilliz 13 | © Copyright 8/16/23 Zilliz Database + Vector Plugin? • Limited functionality - Filtering, Hybrid search, Range search • Scalability concerns - sharing vector data has its unique challenge • And LLM is evolving fast, itʼs hard to catch up!
  • 14. 14 | © Copyright 8/16/23 Zilliz 14 | © Copyright 8/16/23 Zilliz Design Principles • Disaggregate storage and computation • Fully depends on mature storage systems • Micro Service - scale by functionality • Separate Streaming and historical data • Pluggable engine, storage and index • Log As data
  • 15. 15 | © Copyright 8/16/23 Zilliz 15 | © Copyright 8/16/23 Zilliz Meta Storage Root Query Data Index Coordinator Service Proxy Proxy etcd Log Broker SDK Load Balancer DDL/DCL DML NOTIFICATION CONTROL SIGNAL Object Storage Minio / S3 / AzureBlob Log Snapshot Delta File Index File Worker Node QUERY DATA DATA Message Storage VECTOR DATABASE Access Layer Query Node Data Node Index Node Milvus Architecture
  • 16. 16 | © Copyright 8/16/23 Zilliz 16 | © Copyright 8/16/23 Zilliz Entity
  • 17. 17 | © Copyright 8/16/23 Zilliz 17 | © Copyright 8/16/23 Zilliz Each shard is managed by a supervisor (shard leader). This supervisor is responsible for: • Adding new information to the shard. • Regularly storing the data in a safe place (object storage). • Serving the latest information for search requests. • Forwarding historical data requests to other cabinets (query nodes) if needed. Milvus Data Layout - Shard
  • 18. 18 | © Copyright 8/16/23 Zilliz 18 | © Copyright 8/16/23 Zilliz Growing Segment: • In-memory segment replaying data from the Log Broker. • Uses a FLAT index to ensure data is fresh and appendable. Sealed Segment: • Immutable segment using alternative indexing methods for efficiency. Milvus Data Layout - Segments
  • 19. 19 | © Copyright 8/16/23 Zilliz 19 | © Copyright 8/16/23 Zilliz Behind the Scenes: How Data Gets Added and Accessed • Sharding: Large datasets are divided into smaller, manageable sections called shards. Each shard is handled by a dedicated datanode. • Write-Ahead Log WAL: When you add new data, a proxy service writes it to a temporary log called a WAL (e.g., Kafka, Pulsar). Think of it as a to-do list for the datanodes.
  • 20. 20 | © Copyright 8/16/23 Zilliz 20 | © Copyright 8/16/23 Zilliz Behind the Scenes: How Data Gets Added and Accessed • Datanodes subscribe to the WAL and: • Add new data to their assigned shard. • Remove outdated data (if needed) • Flush accumulated data to permanent storage. • Query Nodes also subscribe to the WAL but focus on: • Creating and managing Segments within each shard for fast searching. • Ensuring searches access the latest information.
  • 21. 21 | © Copyright 8/16/23 Zilliz 21 | © Copyright 8/16/23 Zilliz Index Building To avoid frequent index building for data updates. A collection in Milvus is divided further into segments, each with its own index.
  • 22. 22 | © Copyright 8/16/23 Zilliz 22 | © Copyright 8/16/23 Zilliz Data query refers to: • Searching a specified collection for k number of vectors nearest to a target vector or for all vectors within a specified distance range to the vector. Data query
  • 23. 23 | © Copyright 8/16/23 Zilliz 23 | © Copyright 8/16/23 Zilliz | © Copyright 8/16/23 Zilliz 23 Handling Data Updates in Milvus
  • 24. 24 | © Copyright 8/16/23 Zilliz 24 | © Copyright 8/16/23 Zilliz Things to avoid! • Auto increment Primary Keys • Auto Generated IDs based on something you donʼt know
  • 25. 25 | © Copyright 8/16/23 Zilliz 25 | © Copyright 8/16/23 Zilliz Identifier Strategies Unique Identifiers • Ensure each piece of data (e.g., documents, images, or vectors) has a unique identifier. Example: Assign UUIDs to each document or vector for precise identification and retrieval. Metadata Tagging • Attach metadata to each data item to facilitate quick searches and categorization. Example: Add tags such as date_created, author, and content_type to documents. For instance, a document might have metadata: {"id": "12345", "date_created": "2024-06-06", "author": "John Doe", "content_type": "research_paper"}
  • 26. 26 | © Copyright 8/16/23 Zilliz 26 | © Copyright 8/16/23 Zilliz Composite Identifiers • Combine multiple fields to create a unique identifier. Example: Combine user_id and timestamp to create unique IDs for user-generated content. E.g. {"id": "user123_20240606T123000"} Hierarchical IDs • Use hierarchical structures for complex data sets. Example: For a hierarchical document system, use IDs like {"id": "projectA_chapter1_section2"} Identifier Strategies
  • 27. 27 | © Copyright 8/16/23 Zilliz 27 | © Copyright 8/16/23 Zilliz Update Process with Pymilvus
  • 28. 28 | © Copyright 8/16/23 Zilliz 28 | © Copyright 8/16/23 Zilliz Update Process in a Partition
  • 29. 29 | © Copyright 8/16/23 Zilliz 29 | © Copyright 8/16/23 Zilliz Upsert Entities with Langchain
  • 30. 30 | © Copyright 8/16/23 Zilliz 30 | © Copyright 8/16/23 Zilliz A Detailed Look 1. Identify the Data Needing an Update a. Prepares the updated content along with the primary key of the document. 2. Data Transmission to the Proxy a. The application sends an upsert request to the Milvus client SDK. b. The SDK transmits the request (containing updated data and primary key) to the Proxy service. 3. Proxy communicates with Data Coordinator a. Data Node checks PK 4. Upserts a. Update or add new document to the collection
  • 31. 31 | © Copyright 8/16/23 Zilliz 31 | © Copyright 8/16/23 Zilliz A Detailed Look (next) 5. Data Allocation and Indexing a. Data is in the Growing Segment 6. Datanode assigned to the Segment receives the updated data a. Datanode creates a sequence number for the data and stores it b. Data accumulates within the growing segment until a certain condition ⇒ Flush the segment. 7. Flush a. Growing Segment ⇒ Sealed Segment b. Write the data to a permanent storage S3, etc) c. Ensures data persistence and avoids data loss. 8. Re-Indexing a. Milvus triggers re-indexing for the upserted Data
  • 32. 32 | © Copyright 8/16/23 Zilliz 32 | © Copyright 8/16/23 Zilliz milvus.io github.com/milvus-io/ @milvusio @stephenbtl /in/stephen-batifol Connect with me! Thank you!