A Dual-Store Structure for Knowledge Graphs

Zhixin Qi, Hongzhi Wang, Haoran Zhang

TL;DR

This paper introduces a novel "dual-store" architecture for knowledge graphs that combines the scalability of relational databases with the query efficiency of native graph databases. To dynamically optimize which data resides in each store, they propose DOTIL, a reinforcement learning-based tuner that adapts to changing query workloads, significantly improving query performance.

What Problem Does This Paper Address?

Managing large-scale knowledge graphs presents a significant challenge. Traditional relational databases can store vast amounts of data and handle updates efficiently, but they struggle with complex queries that involve many joins, leading to poor performance. Conversely, native graph databases excel at processing these complex queries due to their inherent structure, but they often have limitations in terms of storage capacity and are less flexible for frequent data updates. This creates a dilemma: choose scalability or query performance. The paper addresses this by proposing a hybrid approach that aims to get the best of both worlds.

Methods

The core innovation is a dual-store structure where a relational database stores the entire knowledge graph, and a native graph database acts as an accelerator for complex queries. To manage this hybrid system effectively, the paper introduces DOTIL (Dual-stOre Tuner based on Reinforcement Learning).

DOTIL tackles the crucial problem of deciding what data to move from the relational store to the graph store and when. This is framed as a Markov Decision Process (MDP). The system learns an optimal physical design tuning policy using reinforcement learning, specifically Q-learning.

Key aspects of DOTIL include:

  • Complex Subquery Identification: A component that identifies queries containing complex subgraphs (where variables appear multiple times).
  • Reinforcement Learning: Q-learning is used to train a model that learns the value of migrating specific "triple partitions" (sets of triples with the same predicates) to the graph store.
  • State Space Decomposition: To handle the large state space (2^n, where n is the number of triple partitions), DOTIL decomposes it to improve training efficiency.
  • Counterfactual Scenario: A mechanism to estimate the cost of a query in the relational store even when it's processed in the graph store, enabling accurate reward calculation for the RL agent.

Datasets

The authors evaluated their system using three public knowledge graphs:

  • YAGO: A large knowledge graph derived from Wikipedia and other sources.
  • WatDiv: A benchmark dataset for evaluating SPARQL query engines, with variations like WatDiv-L, WatDiv-S, WatDiv-F, and WatDiv-C representing different query patterns.
  • Bio2RDF: A knowledge graph focused on biological and biomedical data.

They used query templates from YAGO and Bio2RDF, and generated WatDiv queries based on existing templates and mutations.

Key Insights and Ideas

  • Hybridization is Key: The paper demonstrates that a combination of relational and graph stores can overcome the limitations of each individual approach for knowledge graph management.
  • Dynamic Tuning is Crucial: Static partitioning is insufficient. The ability to adapt the data distribution between stores based on evolving workloads is essential for sustained performance.
  • Reinforcement Learning for Optimization: Applying RL to physical design tuning for this dual-store architecture is a novel and effective way to learn complex, adaptive policies.
  • The "What" and "When" of Data Migration: The core challenge isn't just if data should be in the graph store, but which specific data and at what time to maximize query performance.

Key Results

The proposed dual-store structure with DOTIL achieved significant performance improvements:

  • Average Query Performance Improvement: Up to 43.72% compared to the most commonly used relational stores (RDB-only).
  • Comparison with RDB-views: Up to 63.01% improvement compared to a relational store optimized with materialized views.
  • Adaptivity: DOTIL's performance was robust across both ordered and random query workloads, demonstrating its ability to handle dynamic changes.
  • Efficiency: The dual-store tuner DOTIL was shown to be effective even with limited spare resources in the graph store.

Limitations and Future Work

  • Cold Start: While the paper shows the impact of a cold start (initially empty graph store) is manageable, it's an inherent challenge for any adaptive system.
  • Parameter Tuning: The performance of DOTIL is sensitive to parameter choices (e.g., learning rate, discount factor), and extensive tuning was required to find optimal values.
  • Future Work: The authors suggest extending the dual-store structure to handle more challenging scenarios, implying further research into more complex data models or distributed environments.

Summary updated

BibTeX
@article{qi2023dual,
  author = {Zhixin Qi and Hongzhi Wang and Haoran Zhang},
  title = {{A Dual-Store Structure for Knowledge Graphs}},
  journal = {IEEE Trans. Knowl. Data Eng.},
  year = {2023},
  doi = {10.1109/tkde.2021.3093200},
}
Figure