Ensuring Consistency in Graph Cache for Graph-Pattern Queries

Jing Wang, Nikos Ntarmos, Peter TriantafillouEDBT/ICDT Workshops 2017

Abstract

Graph pattern queries are computationally intensive due to the NP-complete nature of the subgraph isomorphism problem. While caching query results can improve performance, dynamic updates to the underlying dataset often invalidate cached entries, leading to frequent cache flushes and redundant computations. This paper presents GC+ (GraphCache+), a consistency-aware caching system designed for dynamic graph datasets. GC+ introduces a fine-grained Consistency (CON) model that tracks the validity of cached results at the individual graph level using bitsets. By selectively updating only the affected portions of the cache, GC+ maintains high performance even under continuous data evolution. Evaluation on the AIDS antiviral dataset shows that GC+ provides speedups of up to 9.5x over standard methods, significantly reducing the number of expensive subgraph isomorphism tests.

Introduction

In modern data ecosystems, graph-structured information is ubiquitous, spanning social networks, biological pathways, and chemical databases. A fundamental operation in these domains is the graph pattern query, which seeks to identify instances of a query graph within a larger dataset. This task is typically modeled as a subgraph isomorphism problem, which is NP-complete and thus highly resource-intensive.

Existing research has explored caching to mitigate these costs. However, most caching solutions assume a static dataset. In practice, datasets are dynamic; for instance, social networks constantly add edges as new connections are formed. When a dataset changes, a "naive" caching strategy might simply evict all entries, forcing the system to recompute results from scratch. This "cold start" problem significantly degrades performance in update-heavy environments. GC+ addresses this by providing a mechanism to maintain cache consistency without total invalidation.

Methodology: The GC+ Framework

The core innovation of GC+ is the transition from a simple Eviction (EVI) model to a sophisticated Consistency (CON) model. While the EVI model clears the cache upon any dataset modification, the CON model employs a fine-grained tracking mechanism.

System Architecture

The GC+ architecture integrates several new components to manage dynamic updates. A Log Analyzer monitors dataset changes (additions, deletions, or updates) and categorizes them. These logs are then processed by a Cache Validator, which updates the cache's internal state.

GC+ System Architecture highlighting the Log Analyzer and Cache Validator components

The Consistency (CON) Model

In the CON model, each cached query is associated with a BitSet called CGvalid. This bitset serves as an indicator for each graph in the dataset, specifying whether the cached result for that specific graph remains valid. When an update occurs, the Cache Validator selectively flips bits in CGvalid based on the nature of the change.

For example, adding an edge to a dataset graph cannot invalidate an existing subgraph match; it can only potentially create a new match. Conversely, removing an edge cannot create a new match but may invalidate an existing one. By leveraging these logical properties, GC+ avoids re-running expensive isomorphism tests for results that are guaranteed to remain valid.

Experimental Evaluation

The authors evaluated GC+ using the AIDS antiviral screen dataset, comprising 40,000 chemical compound graphs. The workload included 2,000 batch operations (Add, Delete, Update) and 10,000 queries of varying complexity (4 to 20 edges).

Performance Results

GC+ was tested against several state-of-the-art subgraph isomorphism algorithms, including VF2, VF2+, and GraphQL. The results consistently demonstrated the superiority of the CON model.

Query time speedup for GC+ across various algorithms and update frequencies

Key findings include:

  • Significant Speedups: The CON model achieved speedups between 1.2x and 9.5x compared to non-cached baselines.
  • Reduced Computational Load: The number of expensive subgraph isomorphism tests was reduced by nearly an order of magnitude in several scenarios.
  • Low Overhead: The computational cost of maintaining the CGvalid bitsets was found to be negligible, typically accounting for less than 1% of total query processing time.

Conclusion and Future Work

GC+ effectively bridges the gap between high-performance graph caching and dynamic data environments. By replacing coarse-grained eviction with fine-grained consistency tracking, it preserves the utility of the cache across updates.

Future research directions include extending GC+ to support pattern matching in single, massive monolithic graphs (e.g., large-scale social networks) and developing "retrospective validation" techniques to recover cache entries that were previously marked invalid. Additionally, exploring distributed architectures for GC+ could enable scaling to even larger query workloads and datasets.

Summary updated

BibTeX
@inproceedings{wang2017ensuring,
  author = {Jing Wang and Nikos Ntarmos and Peter Triantafillou},
  title = {{Ensuring Consistency in Graph Cache for Graph-Pattern Queries}},
  booktitle = {EDBT/ICDT Workshops},
  year = {2017},
}
Figure