Abstract
We study persistent query evaluation over streaming graphs, which is becoming increasingly important. We focus on navigational queries that determine if there exists a path between two entities that satisfies a user-specified constraint. We adopt the Regular Path Query (RPQ) model that specifies navigational patterns with labeled constraints. We propose deterministic algorithms to efficiently evaluate persistent RPQs under both arbitrary and simple path semantics in a uniform manner. Experimental analysis on real and synthetic streaming graphs shows that the proposed algorithms can process up to tens of thousands of edges per second and efficiently answer RPQs that are commonly used in real-world workloads.
Introduction
Graphs are ubiquitous in modern data infrastructure, representing everything from social interactions to financial transactions. As these graphs evolve in real-time, the ability to perform persistent navigational queries becomes critical for applications like fraud detection and recommendation systems. Regular Path Queries (RPQs) are a standard tool for this, allowing users to search for paths matching specific regular expression patterns. However, existing graph databases are largely optimized for static snapshots. Evaluating persistent RPQs over high-speed, unbounded streams requires new approaches that avoid the prohibitive cost of re-evaluating queries from scratch as the data window slides.
Methodology
The proposed system evaluates queries over a time-based sliding window. To achieve high throughput, it avoids full re-computation by using an incremental evaluation framework based on automata and product graphs.
As shown in the figure above, the process begins by converting the RPQ's regular expression into a Deterministic Finite Automaton (DFA). As new edges arrive in the stream, the algorithm traverses the graph and the DFA simultaneously to maintain a product graph. This product graph represents all possible states the query can reach at any given time.
The Δ Tree Index
The core innovation of this work is the Δ tree index, a forest of spanning trees that caches partial path matches. Instead of searching the entire graph for every new edge, the algorithm checks if an incoming edge extends an existing path recorded in the Δ index.
This index supports two distinct semantics: RAPQ for arbitrary paths (allowing cycles) and RSPQ for simple paths (no repeating nodes). A significant advantage of this architecture is its unified approach to data removal. Whether an edge expires by falling out of the sliding window or is explicitly deleted by a user, the system uses the same pruning machinery to update the Δ tree index, maintaining consistency with minimal overhead.
Experimental Evaluation
The algorithms were tested on diverse datasets, including the dense Stackoverflow (SO) interaction graph (63M edges), the LDBC Social Network Benchmark (40M edges), and the massive Yago2s knowledge graph (220M edges).
Key findings from the evaluation include:
- High Throughput: The system processes tens of thousands of edges per second with sub-millisecond latency on a single 32-core machine.
- Performance Gains: Compared to emulating streaming queries in a state-of-the-art static RDF database (Virtuoso), the RAPQ algorithm achieved up to a 1,000x improvement in throughput and tail latency.
- Robustness: The system handles explicit deletions efficiently; even with a 10% deletion rate, the performance penalty remains manageable and stabilizes quickly.
Conclusion and Future Work
This work provides the first efficient algorithms for persistent RPQs on streaming graphs. By leveraging incremental updates and the Δ tree index, the system achieves performance levels suitable for real-time production environments. Future research will focus on extending these techniques to property graphs with complex attributes, handling out-of-order data delivery in distributed environments, and optimizing for multi-query workloads.
Summary updated