Fixed-precision approximate continuous aggregate queries in peer-to-peer databases

Farnoush Banaei Kashani, Cyrus ShahabiCollaborateCom 2010

Introduction

In massive peer-to-peer (P2P) networks, data is fragmented across thousands of nodes that are constantly joining, leaving, or updating their local information. Executing continuous aggregate queries—such as monitoring the average available memory or tracking temperature fluctuations across a distributed sensor network—presents a significant challenge. Obtaining exact answers in real-time is often computationally and communicationally prohibitive due to high network churn and the sheer volume of updates.

Traditional approximate query solutions, like histograms or pre-computed samples, often struggle with the dynamic nature of P2P environments. Meanwhile, centralized stream processing techniques are inapplicable to decentralized architectures. This paper introduces Digest, a two-tier system designed to provide "fixed-precision" answers to continuous queries while drastically reducing network overhead.

The Digest Architecture

Digest employs a two-tier architecture to decouple the logic of query evaluation from the mechanics of data collection. This separation allows the system to optimize communication by only requesting data when the predicted change in the aggregate value is likely to exceed a user-defined threshold.

The two-tier architecture of the Digest system, separating query evaluation from distributed sampling.

Top Tier: Query Evaluation Engine

The top tier manages the timing and scale of sampling through two primary mechanisms:

  1. Extrapolation Algorithm: By treating the aggregate value as a smooth analytic function, Digest uses Taylor series expansion to predict future values. If the predicted change remains below a resolution threshold ($\delta$), the system skips the sampling process, preserving network resources.
  2. Repeated Sampling via Regression: Recognizing that data in these networks is often autocorrelated, Digest uses regression estimation to correlate new samples with previous ones. This allows the system to maintain high confidence levels with fewer new samples compared to independent sampling methods.

Bottom Tier: Distributed Sampling Operator

The bottom tier handles decentralized data collection using Metropolis Markov Chain Monte Carlo (MCMC) sampling. A sampling agent performs a random walk across the unstructured network, moving between nodes based on local neighbor weights. This ensures a globally representative sample is obtained using only local information, without requiring a central index.

Defining Precision

Digest defines precision through a two-dimensional framework. Resolution ($\delta$) filters out insignificant temporal fluctuations, while Confidence (defined by error margin $\epsilon$ and probability $p$) ensures that each individual snapshot is statistically accurate.

Comparison of exact and approximate results over time, illustrating the resolution threshold (δ) and error margin (ε).

As shown in the figure above, the approximate result $\hat{X}[t]$ tracks the exact result $X[t]$ within the bounds defined by the user. The system only triggers a new update (at times $t_{u_i}$) when the extrapolation logic determines that the current estimate may no longer satisfy the precision requirements.

Experimental Evaluation

The authors evaluated Digest using two real-world datasets representing different network dynamics:

  • TEMPERATURE: Data from 530 JPL/NASA weather stations (8.6 million tuples), representing a stable network with slow-changing data.
  • MEMORY: Data from 820 SETI@HOME nodes (95,445 tuples), representing a high-churn environment with continuous updates.

Key Results

  • Efficiency Gains: The combination of extrapolation and repeated sampling improved query evaluation efficiency by up to 320% compared to naive continuous sampling.
  • Communication Reduction: Digest reduced network traffic by one to two orders of magnitude compared to traditional push-based or filter-based methods.
  • Snapshot Reduction: For specific resolution thresholds, the extrapolation algorithm successfully skipped up to 75% of required snapshot queries while maintaining the requested precision.
  • Scalability: The sampling cost was found to be poly-logarithmic, indicating that Digest scales effectively as the network size increases.

Conclusion and Future Work

Digest demonstrates that fixed-precision approximate queries are a viable and efficient alternative to exact monitoring in large-scale P2P databases. By leveraging prediction and sample reuse, the system significantly lowers the communication barrier for continuous aggregation. Future research will focus on extending Digest to support more complex queries, such as those involving joins, and exploring "forward regression" to retroactively smooth estimated trend lines based on new data.

Summary updated

BibTeX
@inproceedings{kashani2010fixed,
  author = {Farnoush Banaei Kashani and Cyrus Shahabi},
  title = {{Fixed-precision approximate continuous aggregate queries in peer-to-peer databases}},
  booktitle = {CollaborateCom},
  year = {2010},
  doi = {10.4108/icst.collaboratecom.2010.2},
}
Figure