Table of Contents
Fetching ...

One-Hop Sub-Query Result Caches for Graph Database Systems

Hieu Nguyen, Jun Li, Shahram Ghandeharizadeh

TL;DR

The paper tackles tail-latency in graph transactions by introducing a one-hop sub-query result cache that maps each one-hop sub-query instance to an immutable list of leaf vertex IDs. The cache is built from registered one-hop templates and populated asynchronously, with gRW-Txs maintaining cache consistency via write-around or write-through policies; the implementation integrates JanusGraph, FoundationDB, and a Service Coordinator. Evaluation on production-like workloads shows substantial tail-latency improvements for gR-Txs (and, notably, gains even for queries not referencing one-hop sub-queries) and meaningful reductions in gRW-Tx latency and cache-related errors, especially when combined with query rewriting guided by Amdahl’s Law. The work demonstrates strong practical impact for real-time graph-based decision systems and outlines paths for memory-resident caches and cache-aware data-flow architectures as future directions.

Abstract

This paper introduces a novel one-hop sub-query result cache for processing graph read transactions, gR-Txs, in a graph database system. The one-hop navigation is from a vertex using either its in-coming or out-going edges with selection predicates that filter edges and vertices. Its cache entry identifies a unique one-hop sub-query (key) and its result set consisting of immutable vertex ids (value). When processing a gR-Tx, the query processor identifies its sequence of individual one-hop sub-queries and looks up their results in the cache. A cache hit fetches less data from the storage manager and eliminates the requirement to process the one-hop sub-query. A cache miss populates the cache asynchronously and in a transactional manner, maintaining the separation of read and write paths of our transactional storage manager. A graph read and write transaction, gRW-Tx, identifies the impacted cache entries and either deletes or updates them. Our implementation of the cache is inside the graph query processing engine and transparent to a user application. We evaluate the cache using our eCommerce production workload and with rules that re-write graph queries to maximize the performance enhancements observed with the cache. Obtained results show the cache enhances 95th and 99th percentile of query response times by at least 2x and 1.63x, respectively. When combined with query re-writing, the enhancements are at least 2.33x and 4.48x, respectively. An interesting result is the significant performance enhancement observed by the indirect beneficiaries of the cache, gRW-Txs and gR-Txs that do not reference one-hop sub-queries. The cache frees system resources to expedite their processing significantly.

One-Hop Sub-Query Result Caches for Graph Database Systems

TL;DR

The paper tackles tail-latency in graph transactions by introducing a one-hop sub-query result cache that maps each one-hop sub-query instance to an immutable list of leaf vertex IDs. The cache is built from registered one-hop templates and populated asynchronously, with gRW-Txs maintaining cache consistency via write-around or write-through policies; the implementation integrates JanusGraph, FoundationDB, and a Service Coordinator. Evaluation on production-like workloads shows substantial tail-latency improvements for gR-Txs (and, notably, gains even for queries not referencing one-hop sub-queries) and meaningful reductions in gRW-Tx latency and cache-related errors, especially when combined with query rewriting guided by Amdahl’s Law. The work demonstrates strong practical impact for real-time graph-based decision systems and outlines paths for memory-resident caches and cache-aware data-flow architectures as future directions.

Abstract

This paper introduces a novel one-hop sub-query result cache for processing graph read transactions, gR-Txs, in a graph database system. The one-hop navigation is from a vertex using either its in-coming or out-going edges with selection predicates that filter edges and vertices. Its cache entry identifies a unique one-hop sub-query (key) and its result set consisting of immutable vertex ids (value). When processing a gR-Tx, the query processor identifies its sequence of individual one-hop sub-queries and looks up their results in the cache. A cache hit fetches less data from the storage manager and eliminates the requirement to process the one-hop sub-query. A cache miss populates the cache asynchronously and in a transactional manner, maintaining the separation of read and write paths of our transactional storage manager. A graph read and write transaction, gRW-Tx, identifies the impacted cache entries and either deletes or updates them. Our implementation of the cache is inside the graph query processing engine and transparent to a user application. We evaluate the cache using our eCommerce production workload and with rules that re-write graph queries to maximize the performance enhancements observed with the cache. Obtained results show the cache enhances 95th and 99th percentile of query response times by at least 2x and 1.63x, respectively. When combined with query re-writing, the enhancements are at least 2.33x and 4.48x, respectively. An interesting result is the significant performance enhancement observed by the indirect beneficiaries of the cache, gRW-Txs and gR-Txs that do not reference one-hop sub-queries. The cache frees system resources to expedite their processing significantly.

Paper Structure

This paper contains 17 sections, 8 figures, 9 tables, 9 algorithms.

Figures (8)

  • Figure 1: A Gremlin query with a one-hop sub-query.
  • Figure 2: Graph service architecture.
  • Figure 3: Asynchronous read query processing with cache.
  • Figure 4: Production traffic for 4 days, primary data center.
  • Figure 5: Production and Test systems.
  • ...and 3 more figures

Theorems & Definitions (5)

  • definition 1
  • definition 2
  • definition 3
  • definition 4
  • definition 5