Real-Time Spatial Queries for Moving Objects Using Storm Topology

Feng Zhang, Ye Zheng, Dengping Xu, Zhenhong Du, Yingzhi Wang, Renyi Liu, Xinyue YeIsprs Int. J. geo inf 2016 · DOI

TL;DR

This paper tackles the challenge of real-time spatial querying for massive, rapidly changing datasets of moving objects. They propose a distributed spatial index built on Apache Storm, a real-time computation system, to efficiently handle high update rates and complex queries like range and K-nearest neighbor searches, and importantly, spatial joins between moving datasets.

What Problem Does This Paper Address?

The proliferation of mobile data acquisition technologies has led to an explosion of spatial data, particularly from moving objects like vehicles and people. Analyzing this data in real-time is crucial for applications ranging from emergency response to traffic management. However, traditional spatial indexing methods, often designed for static data and single-node architectures, struggle to cope with the sheer volume and high update frequency of dynamic spatial data streams. Existing distributed solutions, while offering more computational power, often rely on batch processing or are not optimized for the continuous, tuple-by-tuple nature of real-time data streams. This creates a bottleneck in efficiently querying and analyzing these dynamic datasets.

Methods

The core of this work is the development of a distributed spatial index leveraging Apache Storm. Storm's ability to process data streams tuple-by-tuple, rather than in micro-batches, makes it well-suited for the high update rates of moving objects.

The authors propose two main approaches:

  • Single Dataset Queries: A distributed index is built within a Storm topology. Data is grouped by object ID, and each bolt instance maintains a partition of the spatial index in memory. This alleviates the pressure on individual nodes for updates and queries. They implement continuous K-nearest neighbor (CKNN) queries using the iSEE algorithm.
  • Spatial Joins for Moving Objects: For spatial joins between two datasets, grouping by object ID is insufficient. Instead, they introduce a grid-partition index as the primary index. Each grid cell stores points within its boundaries and also points that are spatially correlated (within a defined join distance) but fall into adjacent cells. This is crucial because different bolt instances cannot communicate directly. A secondary index (e.g., D-Rtree, D-HashTable, D-QuadTree) is used within each cell to manage these points. They also introduce an "element table" as an alternative to the secondary index for storing join results, which can be more space-efficient when the number of spatial joins is sparse.

The system architecture involves spouts for data ingestion (update and query) and bolts for processing, with specific bolts for updating partitions, managing the distributed spatial index, and aggregating results.

Datasets

The paper uses synthetic network data generated by a modified version of Brinkhoff's algorithm. The network data is based on the road network of Jiangsu Province, China. They describe two types of workloads:

  • Single-dataset experiments: 1 million dynamic points with an update rate of 0.7 m/s.
  • Spatial join experiments: Two sets of moving objects with varying numbers of objects and grid cell configurations.

No new benchmarks are introduced; rather, they use a realistic synthetic dataset to evaluate their proposed methods.

Key Insights and Ideas

  • Storm's Suitability for Real-Time Spatial Data: The tuple-by-tuple processing of Apache Storm is a key enabler for handling the high-frequency updates of moving object data, outperforming micro-batching approaches for this specific use case.
  • Grid-Partitioning for Spatial Joins: The grid-partition index is essential for spatial joins because it allows for the distribution of spatially correlated points across different nodes, overcoming the limitations of ID-based grouping.
  • Quadtree as a Superior Secondary Index: Experiments consistently show that a quadtree-based secondary index offers better performance for spatial join queries compared to R-trees and hash tables, balancing update and query efficiency.
  • Trade-offs in Parallelism: Increasing parallelism in single-dataset queries initially improves update rates but can lead to performance degradation beyond a certain point due to increased inter-node communication overhead.
  • Query Range Size Impact: Larger query range sizes can positively influence spatial join throughput, suggesting that the query process itself is less of a bottleneck than updates, and larger ranges engage more executors.

Key Results

  • Single Dataset Performance: The proposed distributed index on Storm shows good performance for range and CKNN queries, with update rates increasing with parallelism up to a saturation point.
  • Spatial Join Performance:
    • D-Quadtree consistently outperforms D-Rtree and D-HashTable in terms of spatial join update throughput across various numbers of objects and grid cells.
  • The number of moving objects has a significant impact on D-HashTable and D-Rtree, while D-Quadtree is less affected.
  • The number of grid cells influences performance differently: for D-Rtree, finer grids are better; for D-HashTable, coarser grids are better. D-Quadtree shows a balanced performance.
  • Increasing the update/query ratio generally increases spatial join throughput, indicating that query latency is lower than update latency. Larger query ranges also tend to increase throughput.

Limitations and Future Work

  • Hyper-Skewed Workloads: The paper acknowledges that when all kinematic points are assigned to the same grid partition, it can lead to hyper-skewed workloads, which are not explicitly addressed.
  • Future Work: The authors plan to investigate how to address hyper-skewed workloads. They also intend to compare their Storm-based approach with other emerging distributed streaming frameworks like Apache Flink to identify the best platforms for GIS applications. The system has been integrated into a real-time traffic monitoring system, demonstrating its practical applicability.

Summary updated

BibTeX
@article{zhang2016real,
  author = {Feng Zhang and Ye Zheng and Dengping Xu and Zhenhong Du and Yingzhi Wang and Renyi Liu and Xinyue Ye},
  title = {{Real-Time Spatial Queries for Moving Objects Using Storm Topology}},
  journal = {Isprs Int. J. geo inf},
  year = {2016},
  doi = {10.3390/ijgi5100178},
}
Figure