OneDB: A Distributed Multi-Metric Data Similarity Search System

Tang Qian, Yifan Zhu, Lu Chen, Xiangyu Ke, Jingwen Zhao, Tianyi Li, Yunjun Gao, Christian S. JensenarXiv 2025 · DOI

TL;DR

This paper introduces OneDB, a distributed system for efficient and accurate similarity search across diverse multi-modal datasets. It tackles the challenge of combining information from different data types (like images, text, and sensor data) by learning optimal ways to weigh their contributions, leading to significantly faster and more precise search results.

What Problem Does This Paper Address?

The world is awash in multi-modal data – think of your social media feeds, medical records combining images and text, or e-commerce product listings with descriptions and photos. Effectively searching and retrieving relevant information from these diverse datasets is a huge challenge. Existing systems often treat each data type in isolation, or they try to force them into a single representation, which can lead to inaccurate results or inefficient processing. The core problem is how to build a system that can understand and query across these different data modalities in a way that is both accurate and scalable for massive datasets.

Methods

OneDB introduces several key innovations to tackle this problem:

  • Multi-Metric Space Model: The system treats each data modality (e.g., images, text) as its own "metric space" with its own distance function. It then unifies these into a "multi-metric space" where similarity is calculated by combining distances across these individual spaces.
  • Lightweight Modality Weight Learning: Instead of users manually specifying how much each data type should matter, OneDB learns these "weights" automatically. It uses a contrastive learning approach with a clever strategy for generating positive and negative examples from user queries, enabling it to learn effective weights even with limited user input.
  • Dual-Layer Indexing: To handle distributed data efficiently, OneDB uses a two-tiered indexing strategy. A global index partitions the data across nodes, and then local indexes on each worker node are specialized for each data modality. This balances load distribution and allows for efficient, modality-specific pruning during searches.
  • End-to-End Parameter Auto-Tuning: Real-world distributed systems have many parameters that are hard to tune manually. OneDB employs reinforcement learning (specifically, Deep Deterministic Policy Gradient) to automatically optimize these system parameters, adapting to dynamic environments and improving performance.
  • Extended SQL Interface: OneDB integrates with Apache Spark, offering an extended SQL interface for querying multi-modal data, making it more accessible to users familiar with database query languages.

Datasets

The paper evaluates OneDB on three real-life datasets and two synthetic datasets:

  • Air: Hourly measurements of air pollutants.
  • Food: Detailed information on food products, including nutritional facts and additives.
  • Rental: Apartment listings in New York with features like price, location, and reviews.
  • Synthetic: Randomly generated data to test scalability.
  • Synthetic II: A larger version of the synthetic dataset for evaluating performance with millions of features.

Key Insights and Ideas

  • The Power of Learned Weights: The most significant insight is that automatically learning modality weights, rather than relying on fixed or user-defined ones, dramatically improves search accuracy. This reflects real-world scenarios where user intent is often expressed through examples, not explicit numerical weights.
  • Dual-Layer Indexing is Crucial for Scalability: The combination of a global partitioning index and specialized local indexes is key to achieving both efficient load balancing and fast, pruned searches in a distributed environment.
  • Reinforcement Learning for System Optimization: Applying RL to tune system parameters in a dynamic, distributed setting is a powerful approach to overcome the limitations of manual tuning and static cost models. It allows the system to adapt and improve performance over time.
  • Multi-Metric Space is a Natural Fit: Representing diverse data as distinct metric spaces and then unifying them is a flexible and effective way to model complex, multi-modal data.

Key Results

  • Accuracy Improvement: OneDB achieved retrieval accuracy improvements of 12.63% to 30.75% over state-of-the-art vector similarity search systems.
  • Speedup: The system demonstrated accelerated search speeds of 2.5x to 5.75x compared to state-of-the-art single- or multi-metric solutions.
  • Scalability: OneDB showed high scalability, with performance improving significantly as the number of worker nodes increased.
  • Weight Learning Efficiency: The learned weights achieved high recall (around 90%) with training times under 100 seconds.
  • Parameter Tuning Impact: End-to-end parameter tuning enabled performance improvements of 15% to 17%.
  • Construction Cost: OneDB exhibited comparable construction efficiency and less storage cost than some competitors.

Limitations and Future Work

  • Dynamic Data Scenarios: The authors mention that in the future, they plan to explore dynamic data scenarios, suggesting that the current system might be more optimized for static datasets.
  • Index Flexibility: While OneDB supports R-trees, MVP-trees, and inverted indexes, the paper notes that it is flexible enough to integrate other index structures, implying that further exploration of index types could be beneficial.
  • Interpretability of Weights: While the learned weights generally align with demo results, deeper interpretability of how these weights translate to specific user intents could be a future research direction.

Summary updated

Abstract

Increasingly massive volumes of multi-modal data are being accumulated in many {real world} settings, including in health care and e-commerce. This development calls for effective general-purpose data management solutions for multi-modal data. Such a solution must facilitate user-friendly and accurate retrieval of any multi-modal data according to diverse application requirements. Further, such a solution must be capable of efficient and scalable retrieval. To address this need, we present OneDB, a distributed multi-metric data similarity retrieval system. This system exploits the fact that data of diverse modalities, such as text, images, and video, can be represented as metric data. The system thus affords each data modality its own metric space with its own distance function and then uses a multi-metric model to unify multi-modal data. The system features several innovations: (i) an extended Spart SQL query interface; (ii) lightweight means of learning appropriate weights of different modalities when retrieving multi-modal data to enable accurate retrieval; (iii) smart search-space pruning strategies that improve efficiency; (iv) two-layered indexing of data to ensure load-balancing during distributed processing; and (v) end-to-end system parameter autotuning. Experiments on three real-life datasets and two synthetic datasets offer evidence that the system is capable of state-of-the-art performance: (i) efficient and effective weight learning; (ii) retrieval accuracy improvements of 12.63\%--30.75\% over the state-of-the-art vector similarity search system at comparable efficiency; (iii) accelerated search by 2.5--5.75x over state-of-the-art single- or multi-metric solutions; (iv) demonstrated high scalability; and (v) parameter tuning that enables performance improvements of 15+%.
BibTeX
@misc{qian2025onedb,
  author = {Tang Qian and Yifan Zhu and Lu Chen and Xiangyu Ke and Jingwen Zhao and Tianyi Li and Yunjun Gao and Christian S. Jensen},
  title = {{OneDB: A Distributed Multi-Metric Data Similarity Search System}},
  year = {2025},
  eprint = {2507.04256},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.04256},
}
Figure