how to deal with cliques at work - inria · pdf filehow to deal with cliques at work ... 1 ......

5
HAL Id: hal-01072060 https://hal.inria.fr/hal-01072060 Submitted on 7 Oct 2014 HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés. How to Deal with Cliques at Work Benjamin Djahandideh, François Goasdoué, Zoi Kaoudi, Ioana Manolescu, Jorge Quiané-Ruiz, Stamatis Zampetakis To cite this version: Benjamin Djahandideh, François Goasdoué, Zoi Kaoudi, Ioana Manolescu, Jorge Quiané-Ruiz, et al.. How to Deal with Cliques at Work. BDA’2014: 30e journées Bases de Données Avancées, Oct 2014, Grenoble-Autrans, France. 2014. <hal-01072060>

Upload: dangdan

Post on 21-Mar-2018

223 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: How to Deal with Cliques at Work - Inria · PDF fileHow to Deal with Cliques at Work ... 1 ... Hadoop, for storing and querying big RDF datasets. Clique-Authors: Benjamin Djahandideh

HAL Id: hal-01072060https://hal.inria.fr/hal-01072060

Submitted on 7 Oct 2014

HAL is a multi-disciplinary open accessarchive for the deposit and dissemination of sci-entific research documents, whether they are pub-lished or not. The documents may come fromteaching and research institutions in France orabroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire HAL, estdestinée au dépôt et à la diffusion de documentsscientifiques de niveau recherche, publiés ou non,émanant des établissements d’enseignement et derecherche français ou étrangers, des laboratoirespublics ou privés.

How to Deal with Cliques at WorkBenjamin Djahandideh, François Goasdoué, Zoi Kaoudi, Ioana Manolescu,

Jorge Quiané-Ruiz, Stamatis Zampetakis

To cite this version:Benjamin Djahandideh, François Goasdoué, Zoi Kaoudi, Ioana Manolescu, Jorge Quiané-Ruiz, et al..How to Deal with Cliques at Work. BDA’2014: 30e journées Bases de Données Avancées, Oct 2014,Grenoble-Autrans, France. 2014. <hal-01072060>

Page 2: How to Deal with Cliques at Work - Inria · PDF fileHow to Deal with Cliques at Work ... 1 ... Hadoop, for storing and querying big RDF datasets. Clique-Authors: Benjamin Djahandideh

How to Deal with Cliques at Work

Benjamin Djahandideh1 Francois Goasdoue2,1 Zoi Kaoudi3 Ioana Manolescu1,4

Jorge-Arnulfo Quiane-Ruiz5 Stamatis Zampetakis1,4

1 Inria, France [email protected] 2 Univ. Rennes 1, France [email protected] IMIS, Athena Research Center, Greece [email protected] 4 Univ. Paris Sud, France [email protected]

5 Qatar Computing Research Institute (QCRI) [email protected]

RESUME

RDF est un modele de donnees a la popularite croissantedans les applications reelles, menant ainsi a la creation etl’exploitation de large volumes de donnees RDF. Des metho-des efficaces de gestion de donnees RDF sont cruciales pourpermettre le passage a l’echelle des applications. Dans cettedemonstration, nous mettons en avant la grande efficacitede CliqueSquare, un systeme de gestion de donnees RDFconcu au-dessus d’une infrastructure a la MapReduce. Nousmontrons trois principaux aspects de CliqueSquare: (i) lareduction significative du traffic reseau pendant l’evaluationde requetes, (ii) l’evaluation de requetes potentiellementgrandes en peu de jobs MapReduce et (iii) l’ameliorationdes performances de traitement des requetes par la pro-duction de plans de type DAG. Dans tous les scenariosde demonstration, l’audience est invitee a interagir avec lesysteme pour poser des requetes, explorer et controler lesfonctionnalites des algorithmes d’optimisation de la plate-forme, et enfin de selectionner et monitorer l’evaluation desplans de requete dans deux clusters.

1. INTRODUCTIONThe Resource Description Framework (RDF, in short) [5]

is a flexible data model for representing graph-structureddata. In a nutshell, an RDF dataset consists of triples of theform (s, p, o), stating that a subject has a property whosevalue is object. Nowadays, many applications use RDF as afirst-class citizen or provide support for RDF data, in areasranging from the Semantic Web and scientific applications,such as BioPAX1 and UniProt2, to Web 2.0 platforms, suchas RDFizers3, and databases [2]. The RDF data model isaccompanied by the SPARQL standard query language forquerying RDF data. Efficient evaluation of SPARQL queriesremains challenging though, due to the lack of structure andregularity in RDF graphs, and because SPARQL queriestypically involve many joins over the RDF data set.

Many algorithms and architectures have been proposedto efficiently manage RDF data [1, 11, 14]. However, scala-bility in RDF data management is still an open problem.The main challenge resides in the sheer size of the dataitself. Many distributed systems, especially MapReduce-based, have been proposed for RDF data management [6,

1http://www.biopax.org2http://dev.isb-sib.ch/projects/uniprot-rdf/3http://smile.mit.edu/wiki/RDFizers

7, 8, 10, 13, 17]. However, performance problems still re-main, essentially for one of these two reasons: (i) they trans-fer a considerable amount of data through the network or(ii) they do not fully exploit the parallelism offered in suchan environment by joining intermediary results sequentially,both of which negatively impact query performance. Othersystems leverage distributed key-value stores to store andindex a large number of RDF triples such as [3, 12, 16].However, as key-value stores do not support joins, thesesystems often perform the joins on a single node. Amongthe above mentioned systems, only [12] leverages MapRe-duce for queries with low selectivity, while Trinity.RDF [16],based on a distributed in-memory key-value store, evaluatesSPARQL queries by navigating the distributed RDF graphand using the results from one triple pattern for the nextone.

In this demo, we present CliqueSquare [15], an efficienthighly-parallel RDF data management platform, on top ofHadoop, for storing and querying big RDF datasets. Clique-Square introduces a novel RDF data storage scheme andquery optimization algorithm (based on query variable cliques,thus the name) which both enable efficient and scalablequery evaluation. Generally speaking, CliqueSquare aimsat reducing both the number of MapReduce jobs and theamount of data transferred through the network. The demohighlights the following three key features: (i) Data Parti-tioning – we show how the data storage provided by Clique-Square helps to perform many queries without any networktraffic; (ii) Job Minimization – we show the benefits in queryperformance achieved by CliqueSquare as a result of havingas few MapReduce jobs as possible; (iii) Redundancy Ex-ploration through DAG-shaped plans – we show how DAG-shaped plans may help reduce the intermediary results andthus, lead to better query performance.

2. CLIQUESQUAREWe introduce CliqueSquare, a platform based on Hadoop.

CliqueSquare relies on a novel RDF data partitioning schemeand a novel query optimization algorithm. These two com-ponents allow CliqueSquare to minimize the number of Map-Reduce jobs as well as the network traffic. Figure 1 outlinesthe data partitioner and the query processor, each of which isbriefly outlined in this Section. A comprehensive descriptionof CliqueSquare can be found in [15].

2.1 Data PartitionerMost distributed file systems replicate input datasets for

fault-tolerance reasons (Hadoop by default replicates the

1

Page 3: How to Deal with Cliques at Work - Inria · PDF fileHow to Deal with Cliques at Work ... 1 ... Hadoop, for storing and querying big RDF datasets. Clique-Authors: Benjamin Djahandideh

Query Parser

Job Translator

variable graph

optimized plan

Plan Optimizer

SPARQLquery

map reducemap reduce

map reduce

CliqueSquare Query Processor

Main operators

CliqueSquare Data Partitioner

partitioned RDF data

map reduce

MapReduce job

MapScan

MapFilter

MapJoin

ReduceJoin

Project

intermediate/final results

Hadoop MapReduce

HDFS

execute

Job Configuration

MapReduce jobs

node n

1 takesCourse-S 1 member-S 1 advisor-O

:stud1 :db :stud1 :dept4 :prof1 :stud1

:stud2 :os :stud2 :dept1 :prof2 :stud2

node n1

1 name-S 1 type#Dep-O 1 member-P

:stud1 "ted" :dept1 :stud1 :dept4

:stud2 :dept1

node n

2 takesCourse-O 2 member-O 2 name-O

:stud1 :db :stud1 :dept4 :prof1 "bob"

:stud2 :os :stud2 :dept1 :prof2 "alice"

2 advisor-P 2 type#Dept-S 2 type#Dept-P

:prof1 :stud1 :dept1 :dept1

:prof2 :stud2

node n2

:prof1

:prof2

“bob”

“alice”

:stud2

:stud1

:dept1 :Dept

:os

“ted”

:db

:dept4

:advisor

:advisor

:name

:name

:member rdf:type

:takesCourse

:member

:takesCourse

:name

uploadRDF data

MapPartitioning

Shuffling

ReduceGrouping

Main operators

Figure 1: CliqueSquare architecture.

data three times). CliqueSquare exploits this data replica-tion to partition and store RDF data three times, based onthe subject, property, and object of triples. Overall, Clique-Square proceeds to store RDF data in three main steps:

MapPartitioning. Triples are partitioned based on theirsubject, property, and object values, which generates threepartitions. At the bottom-left of Figure 1 files with −S ex-tension belong to the subject partition, files with −P to theproperty partition, and files with −O to the object partition.

Shuffling. All partitions corresponding to the same valueare placed on the same compute node. For instance, all thestud1 values, regardless of whether they appear as subjects,objects or properties, are located on node n1 (Figure 1). Tocope with skew issues that may be raised by over-popularvalues in the data, CliqueSquare defines a special partitionfor the rdf:type property (which is part of the RDF standardand thus very popular) as in [9], and splits other partitionsthat are too large based on a predefined threshold [15].

ReduceGrouping. Finally, CliqueSquare groups all the sub-ject, respectively property, and object, partitions inside anode based on the property value, and stores each resultinggroup into HDFS. Looking inside node n1 (Figure 1), weobserve that we have two files for the property member; onebased on the subject partition and one based on the object.

2.2 Query ProcessorQuery processing in CliqueSquare relies on a novel query

optimization model and algorithm based on cliques in queryvariable graphs. The whole process is illustrated in theupper-right part of Figure 1. Given an incoming BasicGraph Pattern (BGP) SPARQL query q, the Query Parser

outputs a variable graph representing q. This graph is thenused by the Plan Optimizer to produce a logical query plan.Finally, the Job Translator transforms the logical plan toa sequence of MapReduce jobs utilizing CliqueSquare oper-ators that can be executed in Hadoop. In the following wefocus on the plan optimization procedure.

Variable graph. Besides representing an initial query,CliqueSquare also uses variable graphs to represent (par-tially) evaluated queries, in which some or all joins havebeen enforced. Formally:

Definition 2.1 (Variable graph). A variable graph

SELECT

?a ?b ?c ?d ?e

WHERE {

?a p1 ?b (t1)?a p2 ?c (t2)?d p3 ?a (t3)?d p4 ?e (t4)?l p5 ?d (t5)?f p6 ?d (t6)?f p7 ?g (t7)?g p8 ?h (t8)?g p9 ?i (t9)?i p10 ?j (t10)?j p11 ?k (t11) }

t4

t5

t3

t6

d

dd d

d

d

t1

t2

a

a

a

t7

t8

t9

gg

gf

t10 t11i j

Figure 2: Query Q1 and its variable graph G1.

GV of a BGP query q is a labeled multigraph (N,E, V ),where V is the set of variables from q, N is the set of nodes,and E ⊆ N × V × N is a set of labeled undirected edgessuch that: (i) each node n ∈ N corresponds to a set of triplepatterns in q; (ii) there is an edge (n1, v, n2) ∈ E betweentwo distinct nodes n1, n2 ∈ N iff their corresponding sets oftriple patterns join on the variable v ∈ V .

Figure 2 shows a query (Q1) and its variable graph, whereevery node represents a single triple pattern.

Variable clique. At the core of the CliqueSquare queryprocessing mechanism lies the concept of variable clique forrepresenting n-way joins. A variable clique is a set of nodesconnected with edges all labeled by the same variable. Amaximal clique comprises all the nodes incident to an edgewith the same variable. For example, in variable graph G1,the maximal clique of d is {t3, t4, t5, t6}. We term any non-empty subset of a maximal clique as partial clique.Based on variable graphs and cliques, CliqueSquare uses

two main operations during its optimization algorithm, namelyclique decomposition and clique reduction.

Clique decomposition. As first step toward building aquery plan, CliqueSquare decomposes a variable graph intoseveral cliques. Formally:

Definition 2.2 (Clique decomposition). Given avariable graph GV = (N,E, V ), a clique decomposition ofGV is a set of variable cliques (maximal or partial) of GV

2

Page 4: How to Deal with Cliques at Work - Inria · PDF fileHow to Deal with Cliques at Work ... 1 ... Hadoop, for storing and querying big RDF datasets. Clique-Authors: Benjamin Djahandideh

which covers all nodes of N , i.e., each node n ∈ N appearsin at least one clique, such that the size of the decompositionis strictly smaller than the number of nodes |N |.

For example, one clique decomposition in the variablegraph G1 is D1 = {{t1, t2, t3}, {t3, t4, t5, t6}, {t6, t7}, {t7, t8,t9}, {t9, t10},{t10, t11}}; this decomposition follows the dis-tribution of colors on the graph edges in Figure 2. There aremore than one ways to decompose the graph; we discuss allalternatives in [15]. From a query optimization perspective,choosing a clique decomposition corresponds to selecting aset of n-way joins to evaluate.

Clique reduction. After having identified a clique de-composition, CliqueSquare shrinks the variable graph into asmaller one. We formally define this process as follows:

Definition 2.3 (Clique reduction). Given a varia-ble graph GV = (N,E, V ) and one of its clique decompo-sitions D, the reduction of GV based on D is the variablegraph G′

V = (N ′, E′, V ) such that: (i) every clique c ∈ D

correspond to a node n′ ∈ N ′, whose set of triple patternsis the union of the nodes involved in c ⊆ N ; (ii) there is anedge (n′

1, v, n′

2) ∈ E′ between two distinct nodes n′

1, n′

2 ∈ N ′

iff their corresponding sets of triple patterns join on the va-riable v ∈ V .

For example, given the above clique decomposition D1,CliqueSquare reduces G1 into a variable graph composed ofone node for each maximal clique in G1 and its correspond-ing edges. From a query optimization perspective, cliquereduction corresponds to applying the joins identified by thegiven decomposition.

CliqueSquare algorithm. CliqueSquare query optimiza-tion algorithms develops possible sequences of clique decom-positions followed by clique reduction, until all the querypredicates have been applied (Algorithm 1). Overall, Clique-Square takes as an input a variable graph G of an incomingquery and a list of variable graphs states modeling the suc-cessive evaluation steps that led to G. As a result, Clique-Square outputs a set of logical query plansQP , each of whichis an alternative way to evaluate the incoming query. Morein detail, CliqueSquare starts processing the variable graphG of the initial query, where each node consists of a singletriple pattern, and the empty queue states. At each recur-sive call, cliqueDecompositions (line 6) returns a set ofclique decompositions ofG, which is used by cliqueReduc-tion (line 8) to reduce G into G′. G′ is in turn recursivelyprocessed, until it consists of a single node. CliqueSquarebuilds the corresponding logical query plan out of the list ofvariable graphs comprised in states (line 3).

Depending on the clique decomposition alternative thatis chosen, eight different instantiations of Algorithm 1 arepossible [15]. Each instantiation results in a different planspace. In our demonstration, the user is allowed to choosebetween four of the most prominent ones and perceive thebenefit of our winner algorithm MSC (minimum simple coversof partial cliques) in terms of efficiency (short optimizationtimes) and effectiveness (rapidly evaluated plans). For moredetails on the different algorithms as well as their formalproperties we point the reader to [15].

Figure 3 shows the runtimes for HadoopRDF [8] (thestate-of-the art Hadoop-based RDF store) and CliqueSquarewith two clique decompositions: MSC+ (minimum simplecovers of maximal cliques) and MSC. We ran these experi-ments on 7 nodes of our cluster, detailed in Section 3.1, us-ing five different queries over a 2 billion triples dataset from

Algorithm 1: CliqueSquare optimization algorithm

CliqueSquare (G, states)Input : Variable graph G; queue of variable graphs

states

Output: Set of logical plans QP

1 states = states ∪ {G};2 if |G| = 1 then3 QP ← createQueryPlans (states);4 else5 QP ← ∅;6 D ← cliqueDecompositions(G);7 foreach D ∈ D do8 G′ ← cliqueReduction(G,D);9 QP ← QP ∪ CliqueSquare (G′, states);

10 end11 end12 return QP ;

end

1!

10!

100!

1000!

Q1! Q2! Q4! Q9! Q15!

Qu

ery

ru

nti

me

(m

in)!

HadoopRDF! CliqueSquare-MSC+! CliqueSquare-MSC!

Figure 3: Query evaluation time for LUBM20K.

the LUBM benchmark. We observe in these results thatCliqueSquare is more than one order of magnitude fasterthan HadoopRDF. We also see the high effectiveness of ouralgorithm MSC, producing plans up to one order of mag-nitude faster than MSC+ (our second best decompositionalgorithm). More experiments are described in [15].

3. DEMONSTRATIONOur goal is to demonstrate CliqueSquare performing a

variety of queries with different characteristics and illustrateits efficiency. The audience is invited to interact with thesystem to compose queries, explore the internals of differentoptimization algorithms, select and monitor the executionprocess of plans in two available clusters.

3.1 SetupWe use a cluster of 8 nodes, where each node has: one

2.93GHz Quad Core Xeon processors; 4×4GB of main mem-ory; 2×600GB SAS hard disks configured in RAID 1; 1 Gi-gabit network; Linux CentOS release 6.4. We divide thiscluster into two equal-size clusters to directly compare dif-ferent techniques of CliqueSquare in some of the scenarios weconsider. We use the popular RDF benchmark LUBM [4].

3.2 Demo ScenariosTo better showcase CliqueSquare to the demo attendees,

we guide them through three different scenarios where theycan see different aspects of CliqueSquare.

(1) Network traffic. We aim at showing how CliqueSquaresignificantly reduces the amount of data to transfer throughthe network by exploiting our sophisticated data partition-ing scheme. In this scenario, the audience is invited to seehow CliqueSquare efficiently executes queries using a map-only job incurring no network traffic at all. For this, the au-dience can choose to run one out of three predefined queries:one that retrieves all the graduate students and the courses

3

Page 5: How to Deal with Cliques at Work - Inria · PDF fileHow to Deal with Cliques at Work ... 1 ... Hadoop, for storing and querying big RDF datasets. Clique-Authors: Benjamin Djahandideh

Figure 4: CliqueSquare graphical user interface.

that they participate in (Q1); one query that retrieves thename, the address, and the research interest of every fullprofessor that works in a specific university (Q2); one queryextending Q2 by having no restriction on the university (Q3).

(2) Number of MapReduce jobs. We show the audi-ence the importance of plans with few jobs by letting themexecute and compare query plans with different numbers ofjobs, created by CliqueSquare for the same query. For thelatter, the following two queries are provided: a query thatreturns the undergraduate students whose advisor is an as-sociate professor and teaches a course they take (Q4); onequery that asks for the undergraduate students of “Univer-sity 3”, whose advisor is a full professor, the courses theyattend, and the email address of their advisor (Q5).

(3) Redundancy exploration. Last but not least, weaim at showing to the audience the benefits in query perfor-mance of having in some cases DAG-shaped, rather thantree-shaped, query plans. DAG-shaped plans result intoreading at least one relation more than once, justifying theuse of term “redundancy”. The audience is able to comparethe running time of DAG-shaped with tree-shaped queryplans. For this, the audience is invited to run one queryasking for graduate students of a department which belongsto the university they hold a degree from (Q6).

3.3 Demo InteractionCliqueSquare comes with an intuitive and interactive graph-

ical user interface to showcase each of the aforementionedscenarios. Figure 4 illustrates its three most important graph-ical interfaces. As a first step, in the left-side graphical inter-face, the audience is able to: (i) select one of the predefinedqueries to demonstrate one of the aforementioned scenarios;(ii) observe the variable graph CliqueSquare creates for eachselected query; (iii) modify any of the predefined queriesto adapt each demo scenario at will; Then, in the centergraphical interface of Figure 4, the audience can: (iv) se-lect one or two of the decomposition algorithms to run; (v)navigate through different visuals of a query plan (logical,physical, MapReduce plan) (vi) select different query plansto study and run; (vii) create their own personalized queryworkloads for realistic evaluations of CliqueSquare; (viii) vi-sualize each of the steps of the query optimization process inCliqueSquare; Finally, in the right-side graphical interface,the audience is invited to: (ix) run their personalized queryworkloads; (x) monitor the progress of the MapReduce jobsresulting from their choices.

4. REFERENCES[1] D. J. Abadi, A. Marcus, and B. Data. Scalable Semantic

Web Data Management using Vertical Partitioning. InVLDB, 2007.

[2] E. I. Chong, S. Das, G. Eadon, and J. Srinivasan. AnEfficient SQL-based RDF Querying Scheme. In VLDB,2005.

[3] A. Crainiceanu, R. Punnoose, and D. Rapp. Rya: AScalable RDF Triple Store For The Clouds. In Cloud-IWorkshop, 2012.

[4] Y. Guo, Z. Pan, and J. Heflin. LUBM: A Benchmark forOWL Knowledge Base Systems. J. Web Sem., 3(2-3), 2005.

[5] P. Hayes. RDF Semantics. W3C Recommendation,February 2004. http://www.w3.org/TR/rdf-mt/.

[6] K. Hose and R. Schenkel. WARP: Workload-AwareReplication and Partitioning for RDF. In DESWEB, 2013.

[7] J. Huang, D. J. Abadi, and K. Ren. Scalable SPARQLQuerying of Large RDF Graphs. PVLDB, 4(11), 2011.

[8] M. Husain, J. McGlothlin, M. M. Masud, L. Khan, andB. M. Thuraisingham. Heuristics-Based Query Processingfor Large RDF Graphs Using Cloud Computing. IEEETrans. on Knowl. and Data Eng., 23(9), Sept. 2011.

[9] M. F. Husain, L. Khan, M. Kantarcioglu, andB. Thuraisingham. Data Intensive Query Processing forLarge RDF Graphs Using Cloud Computing Tools. InIEEE CLOUD, 2010.

[10] H. Kim, P. Ravindra, and K. Anyanwu. From SPARQL toMapReduce: The Journey Using a Nested TripleGroupAlgebra (demo). PVLDB, 4(12), 2011.

[11] T. Neumann and G. Weikum. The RDF-3X Engine forScalable Management of RDF Data. VLDBJ, 19(1), 2010.

[12] N. Papailiou, I. Konstantinou, D. Tsoumakos, andN. Koziris. H2RDF: Adaptive Query Processing on RDFData in the Cloud. In In WWW (demo), 2012.

[13] K. Rohloff and R. E. Schantz. High-Performance, MassivelyScalable Distributed Systems using the MapReduceSoftware Framework: the SHARD Triple-Store. InProgramming Support Innovations for EmergingDistributed Applications, 2010.

[14] C. Weiss, P. Karras, and A. Bernstein. Hexastore: SextupleIndexing for Semantic Web Data Management. PVLDB,1(1), 2008.

[15] Work under submission. Available athttp://cloak.saclay.inria.fr/CliqueSquareExt.pdf, 2014.

[16] K. Zeng, J. Yang, H. Wang, B. Shao, and Z. Wang. ADistributed Graph Engine for Web Scale RDF Data. InPVLDB 2013.

[17] X. Zhang, L. Chen, and M. Wang. Towards Efficient JoinProcessing over Large RDF Graph Using MapReduce. InSSDBM, 2012.

4