Navigation
💾 Data & Storage· 6 min read

Operational Concerns

Index build time, incremental updates, compaction, backup and restore, monitoring index quality over time.

vector-operationsindex-buildupdatescompactionmonitoring

Running a vector database in production requires managing index builds, live updates, compaction, backups, and quality monitoring.


1. Index Build Time

IndexBuild time (10M vectors, 768d)Incremental update?
FlatMinutes✅ (just append)
IVF10-30 minutes⚠️ (need to retrain centroids periodically)
HNSW30-60 minutes✅ (insert into graph)
DiskANN1-2 hours⚠️ (rebuild for best quality)

HNSW is preferred for production — supports incremental inserts without full rebuild.


2. Live Updates

New document → embed → insert into vector index
Delete document → remove from index (mark as deleted)
Update document → delete old + insert new

Compaction: Deleted vectors leave “holes” in the index. Periodic compaction reclaims space:

# Milvus compaction
collection.compact()  # merge segments, reclaim deleted space

3. Monitoring

MetricWhyAlert threshold
Query latency P99User experience> 2× baseline
Recall (sampled)Search quality< target recall
Index sizeCapacity planning> 80% node memory
Insert latencyIngestion pipeline health> 100ms
Segment countCompaction needed> 2× expected

4. Backup and Restore

# Milvus backup
./milvus-backup create --name daily_backup

# Restore to different cluster
./milvus-backup restore --name daily_backup --target new_cluster

Strategy: Daily incremental backups + weekly full backups. Test restore regularly.


Self-Check

  • Estimate index build time for a given vector count and index type
  • Explain compaction and when it’s needed
  • Design a monitoring dashboard for a production vector database
  • Set up backup and restore for a vector database

References