HARMONY: A Scalable Distributed Vector Database for High-Throughput Approximate Nearest Neighbor Search

Qian Xu, Feng Zhang, Chengxi Li, Lei Cao, Zheng Chen, Jidong Zhai, Xiaoyong Du

TL;DR

Harmony is a scalable distributed vector database designed for high-throughput Approximate Nearest Neighbor Search (ANNS). By adaptively combining vector-based and dimension-based partitioning through a cost-model-guided framework, it achieves an average 4.63× throughput improvement on four nodes and mitigates severe load imbalances under skewed workloads.

What Problem Does This Paper Address?

High-dimensional vector search is the backbone of modern AI applications, from recommendation engines to large language model retrieval pipelines. However, scaling these searches to billions of vectors strains single-machine memory and processing capabilities.

Distributed vector databases solve the memory bottleneck by spreading data across multiple nodes, but they introduce a nasty trade-off between load imbalance and communication overhead:

  • Vector-based partitioning shards entire vectors across nodes. While network communication is low, it suffers from severe load imbalance if certain "hot" partitions receive the majority of the queries.
  • Dimension-based partitioning splits the vector dimensions across nodes. This guarantees perfectly balanced compute workloads, but it floods the network with intermediate data transfers to aggregate partial distance results.
Figure 1: An example of overhead in different partition gran- ularity when searching. Where V_i denotes the ith block according to vector-based partition and D_j denotes the jth block according to dimension-based partition.

Methods

The authors introduce Harmony, a distributed ANNS engine that unifies these two paradigms into a hybrid, multi-granularity partitioning scheme. Its core architecture consists of two primary components:

  1. Fine-Grained Query Planner: Guided by an algorithmic cost model, the planner dynamically evaluates the current cluster state and query characteristics. It balances vector shards and dimension splits to minimize both execution time and an "imbalance factor."
  2. Flexible Pipelined Execution Engine: Instead of computing full distances simultaneously, Harmony processes queries in sequential dimension slices across a pipeline of machines.
Harmony's Query Process Overview

This pipelined approach unlocks dimension-level pruning. Because distance metrics like Euclidean distance and dot products are monotonic, Harmony can track the cumulative partial distance of a vector across nodes. If a vector's partial distance exceeds the current top-$K$ search threshold, the system triggers an early stop, safely skipping all remaining dimension calculations on subsequent nodes.

Additionally, because pruning naturally introduces a new form of load imbalance (nodes handling later pipeline stages have less work), Harmony implements an adaptive scheduling strategy that dynamically shuffles the execution order of dimensions for incoming queries.

Datasets

Harmony was evaluated using ten diverse, open-source datasets representing various data modalities:

  • Time Series: Star Light Curves (expanded), Hand Outlines (expanded)
  • Audio: Msong
  • Image: Sift1M, Deep1M, Sift1B
  • Word Vectors & Text: Word2vec, Glove1.2m, Glove2.2m, SpaceV1B

The billion-scale datasets (SpaceV1B and Sift1B) were evaluated using a 16-node cluster configuration.

Key Insights and Ideas

  • Breaking the Linear Speedup Barrier: On a 4-node cluster, Harmony frequently exceeds the theoretical maximum 4× speedup, averaging 4.63×. This "super-linear" scaling is made possible by its aggressive pruning mechanism, which eliminates redundant calculations before they ever hit a worker node's CPU.
  • The Power of Monotonicity: Empirical results show that dimension-level pruning is incredibly effective. By the time the second dimension slice completes processing, nearly 50% of candidate vectors are pruned. By the final slice, the pruning ratio reaches up to 97.4%.
Figure 2: Pruning ratio and time overhead breakdown.
  • Reorganizing, Not Increasing, Data: Finer partitioning of dimensions doesn't actually increase the total volume of transmitted data; it simply reorganizes network traffic into smaller, parallelizable chunks. This keeps Harmony's communication overhead identical to a pure vector-based scheme while reaping the load-balancing benefits of dimension splitting.

Key Results

  • Throughput Gains: Harmony delivers an average 4.63× throughput improvement over single-node Faiss.
  • Skewed Workload Resilience: Under highly imbalanced query workloads where traditional vector partitioning performance drops by 56%, Harmony maintains stability. It outperforms pure dimension-based partitioning by 91% under extreme skew, validating the accuracy of its hybrid cost model.
  • Storage Efficiency: Because each base vector is split across nodes without duplication, Harmony's distributed index requires no additional replication overhead, maintaining an $O(NB \cdot D)$ space complexity that matches standard distributed systems.

Limitations and Future Work

  • Suboptimal for Small Datasets: For smaller vector collections, the communication overhead of passing pipelined intermediate results can dominate the execution time, occasionally rendering Harmony's hybrid approach less effective than standalone, single-machine execution.
  • Low-Precision Trade-offs: When target query recall drops below 99%, the pruning mechanism yields fewer savings. In these low-precision scenarios, a pure vector-partitioning approach sometimes outperforms Harmony's hybrid strategy due to the absence of dimension-slicing overhead.

Summary updated

BibTeX
@article{xu2025harmony,
  author = {Qian Xu and Feng Zhang and Chengxi Li and Lei Cao and Zheng Chen and Jidong Zhai and Xiaoyong Du},
  title = {{HARMONY: A Scalable Distributed Vector Database for High-Throughput Approximate Nearest Neighbor Search}},
  journal = {Proc. ACM Manag. Data},
  year = {2025},
  doi = {10.1145/3749167},
}
Figure