Kaskade: Graph Views for Efficient Graph Analytics

Kaskade: Graph Views for Efficient Graph Analytics

Kaskade: Graph Views for Efficient Graph Analytics Joana M. F. da Trindade∗, Konstantinos Karanasosy, Carlo Curinoy, Samuel Madden∗, Julian Shun∗ ∗MIT CSAIL fjmf, jshun, [email protected], yMicrosoft fccurino, [email protected] Abstract—Graphs are an increasingly popular way to model File1 Job2 real-world entities and relationships between them, ranging from Job1 social networks to data lineage graphs and biological datasets. File2 Queries over these large graphs often involve expensive sub- graph traversals and complex analytical computations. These Job1’s impact real-world graphs are often substantially more structured than Fig. 1: Running example of query over a heterogeneous network: the a generic vertex-and-edge model would suggest, but this insight “blast radius” impact for a given job in a data lineage graph (blue has remained mostly unexplored by existing graph engines for circles correspond to jobs; gray squares to files). graph query optimization purposes. Therefore, in this work, We observe that the graphs in many of these applications we focus on leveraging structural properties of graphs and queries to automatically derive materialized graph views that can have an inherent structure: their vertices and edges have spe- dramatically speed up query evaluation. cific types, following well-defined schemas and connectivity We present KASKADE, the first graph query optimization properties. For instance, social network data might include framework to exploit materialized graph views for query op- users, pages, and events, which can be connected only in timization purposes. KASKADE employs a novel constraint-based specific ways (e.g., a page cannot “like” a user), or workload view enumeration technique that mines constraints from query workloads and graph schemas, and injects them during view management systems might involve files and jobs, with all enumeration to significantly reduce the search space of views to files being created or consumed by some job. As we discuss in be considered. Moreover, it introduces a graph view size estimator § I-A, the provenance graph that we maintain at Microsoft has to pick the most beneficial views to materialize given a query similar structural constraints. However, most existing graph set and to select the best query evaluation plan given a set of query engines do not take advantage of this structure to materialized views. We evaluate its performance over real-world graphs, including the provenance graph that we maintain at improve query evaluation time. Microsoft to enable auditing, service analytics, and advanced sys- At the same time, we notice that similar queries are tem optimizations. Our results show that KASKADE substantially often run repeatedly over the same graph. Such queries can reduces the effective graph size and yields significant performance be identified and materialized as views to avoid significant speedups (up to 50X), in some cases making otherwise intractable computation cost during their evaluation. The aforementioned queries possible. structural regularity of these graphs can be exploited to efficiently and automatically derive these materialized views. I.I NTRODUCTION Like their relational counterparts, such graph views allow us Many real-world applications can be naturally modeled as to answer queries by operating on much smaller amounts graphs, including social networks [1], [2], workflow, and of data, hiding/amortizing computational costs and ultimately dependency graphs as the ones in job scheduling and task ex- delivering substantial query performance improvements of up ecution systems [3], [4], knowledge graphs [5], [6], biological to 50X in our experiments on real-world graphs. As we show, datasets, and road networks [7]. An increasingly relevant type the benefits of using graph views are more pronounced in of workload over these graphs involves analytics computations heterogeneous graphs1 that include a large number of vertex that mix traversals and computation, e.g., finding subgraphs and edge types with connectivity constraints between them. with specific connectivity properties or computing various arXiv:1906.05162v1 [cs.DB] 12 Jun 2019 A. Motivating example metrics over sub-graphs. This has resulted in a large number of systems being designed to handle complex queries over such At Microsoft, we operate one of the largest data lakes graphs [8], [9]. worldwide, storing several exabytes of data and processing them with hundreds of thousands of jobs, spawning billions In these scenarios, graph analytics queries require response of tasks daily [10]. Operating such a massive infrastructure times on the order of a few seconds to minutes, because requires us to handle data governance and legal compliance they are either exploratory queries run by users (e.g., recom- (e.g., GDPR [11]), optimize our systems based on our query mendation or similarity search queries) or they power sys- workloads, and support metadata management and enterprise tems making online operational decisions (e.g., data valuation search for the entire company, similar to the scenarios in [3], queries to control replication, or job similarity queries to drive [4]. A natural way to represent this data and track datasets caching decisions). However, many of these queries involve the and computations at various levels of granularity is to build a enumeration of large subgraphs of the input graph, which can provenance graph that captures data dependencies among jobs, easily take minutes to hours to compute over large graphs on modern graph systems. To achieve our target response times 1By heterogeneous, we refer to graphs that have more than one vertex types, as opposed over large graphs, new techniques are needed. to homogeneous with a single vertex type. tasks, files, file blocks, and users in the lake. As discussed set) and view-based query rewriting (i.e., evaluate a query above, only specific relationships among vertices are allowed, given a set of already materialized views). To the best of our e.g., a user can submit a job, and a job can read or write files. knowledge, this is the first work that employs graph views in To enable these applications over the provenance graph, we graph query optimization. need support for a wide range of structural queries. Finding Constraint-based view enumeration. Efficiently enumerating files that contain data from a particular user or created by a candidate views is crucial for the performance of view-based particular job is an anchored graph traversal that computes query optimization algorithms. To this end, we introduce a the reachability graph from a set of source vertices, whereas novel technique that mines constraints from the graph schema detecting overlapping query sub-plans across jobs to avoid and queries. It then leverages view templates expressed as in- unnecessary computations can be achieved by searching for ference rules to generate candidate views, injecting the mined jobs with the same set of input data. Other queries include constraints at runtime to reduce the search space of views to label propagation (i.e., marking privileged derivative data consider. The number of views our technique enumerates is products), data valuation (i.e., quantifying the value of a further lowered when using the query constraints. dataset in terms of its “centrality” to jobs or users accessing them), copy detection (i.e., finding files that are stored multiple Cost model for graph views. Given the importance of path times by following copy jobs that have the same input dataset), traversals in graph queries, we introduce techniques to estimate and data recommendation (i.e., finding files accessed by other the size of views involving such operations and to compute users who have accessed the same set of files that a user has). their creation cost. Our cost model is crucial for determining We highlight the optimization opportunities in these types which views are the most beneficial to materialize. Our ex- of queries through a running example: the job blast radius. periments reveal that by leveraging graph schema constraints Consider the following query operating on the provenance and associated degree distributions, we can estimate the size graph: “For every job j, quantify the cost of failing it, in of various path views in a number of real-world graphs terms of the sum of CPU-hours of (affected) downstream reasonably well. consumers, i.e., jobs that directly or indirectly depend on j’s execution.” This query, visualized in Fig. 1, traverses the graph Results over real-world graphs. We have incorporated all by following read/write relationships among jobs and files, of the above techniques in our system, KASKADE, and have and computes an aggregate along the traversals. Answering evaluated its efficiency using a variety of graph queries over this query is necessary for cluster operators and analysts to both heterogeneous and homogeneous graphs. KASKADE is quantify the impact of job failures—this may affect scheduling capable of choosing views that, when materialized, speed up and operational decisions. query evaluation by up to 50X on heterogeneous graphs. By analyzing the query patterns and the graph structure, The remainder of this paper is organized as follows.§II pro- we can optimize the job blast radius query in the following vides an overview of KASKADE. § III describes our graph data ways. First, observe that the graph has structural connectivity model and query language, and introduces the notion of graph constraints: jobs produce and consume files, but there are no views in KASKADE.§IV presents K ASKADE’s constraint- file-file or job-job edges. Second, not all vertices and edges in based approach of enumerating graph views, whereas§V the graph are relevant to the query, e.g., it does not use vertices discusses our graph view cost model and our algorithms for representing tasks. Hence, we can prune large amounts of data view selection and view-based query rewriting.§VI gives by storing as a view only vertices and edges of types that are more details on graph views (definitions and examples).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    14 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us