You are on page 1of 5

Techniques and Systems for Large Dynamic Graphs

[Supervisor: M. Tamer Özsu]


Khaled Ammar
Cheriton School of Computer Science
University of Waterloo, Ontario, Canada
khaled.ammar@uwaterloo.ca

ABSTRACT
Many applications regularly generate large graph data. Many
of these graphs change dynamically, and analysis techniques
for static graphs are not suitable in these cases. This thesis
proposes an architecture to process and analyze dynamic
graphs. It is based on a new computation model called
Grab’n Fix. The architecture includes a novel distributed
graph storage layer to support dynamic graph processing.
These proposals were inspired by an extensive quantitative
and qualitative analysis of existing graph analytics plat-
form.

1. INTRODUCTION
Large volumes of data generated from our interaction with Figure 1: System Architecture
software systems that support daily applications in areas
such as commerce, entertainment and social networking have • Facebook had about 829 million daily active users on
given rise to what is commonly referred to as the “Big Data average in June 2014. It has been reported that Face-
Problem”. Scale is key to all aspects of big data manage- book sees activity from half a billion users to generate
ment, and new scalable techniques are required for large- 130TB of logs every day.
scale data management as traditional techniques are no longer • The web graph has more than 40 billion web pages and
effective. several million websites are created every year.
Graph data are of growing importance in this context. Ap- • Business transaction graphs for several online or retail
plications that rely on graph data include the semantic web stores have multiple billion transactions per year.
(i.e., RDF), bioinformatics, finance and trading, and social
networks, among others. Graphs naturally model compli- My research explores both the algorithmic and system as-
cated structures, such as protein interaction networks, prod- pects of building new and scalable solutions for efficient and
uct purchasing, business transactions, relationships and in- effective management, querying and analysis of large and dy-
teractions in social or computer networks, and web page namic graphs. My experiments include real graph datasets
connections. The size and complexity of these graphs raise that require more than 3TB of main memory. The main
significant data management and data analysis challenges. objective is to create a framework that is capable of main-
Graph analytics can be performed on a static or a dynamic taining query answers for very large and dynamic graphs in
graph. Existing graph analytics work mostly focus on static real time. Figure 1 shows the proposed framework and its
graphs. However, since graphs are used to represent rela- main components. Components in red boxes are going to be
tionships between entities, in many cases they change and the focus of my thesis.
evolve - most graph applications are dynamic in nature: I briefly introduce two use cases that would benefit from
dynamic graph analysis:
• Twitter’s users write 500 million tweets per day. Every
Dynamic Clustering: The weakly connected compo-
tweet can influence graphs that model relationships
nent workload is essential for several clustering approaches.
between users, products, interests, locations, etc.
When the clustering dimensions are change over time, the
clustering model needs to be updated frequently to reflect
Permission to make digital or hard copies of all or part of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed new clusters. In several applications, such as the analysis
for profit or commercial advantage and that copies bear this notice and the full cita- of stock market, election, social network, and health infor-
tion on the first page. Copyrights for components of this work owned by others than matics, the dimensions often represent a time series. A suc-
ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or re-
publish, to post on servers or to redistribute to lists, requires prior specific permission cessful application should keep track of all dimensions and
and/or a fee. Request permissions from permissions@acm.org. update the cluster accordingly.
SIGMOD’16 PhD Symp, June 25-July 01 2016, San Francisco, CA, USA Dynamic Network-aware Search: Shortest path is a

c 2016 ACM. ISBN 978-1-4503-4192-9/16/06. . . $15.00 fundamental graph problem that has been used in many ap-
DOI: http://dx.doi.org/10.1145/2926693.2929897 plications for network-aware search. In a social network, web

7
Figure 2: A taxonomy for graph processing techniques.

graph, or wireless network routing, the closeness between The main objective of this thesis is to propose algorithms
two vertices in the graph need to be computed frequently for typical graph workloads that minimize the amount of
as the graph changes. It is essential to build an index that work represented by  in a parallel environment.
can efficiently change rapidly as the original graph changes.
An efficient index would enhance user experience in social 2.1 Graph Processing Techniques
networks to find new friends quickly, and enhance commu- There are several dimensions to categorize graph process-
nication quality in wireless networks. ing techniques, such as: graph models, workload types, dy-
The rest of this paper is organized as follows. Section 2 namicity, algorithm types and computing models. Figure 2
formalizes the problem this research tackles. Section 3 out- summarizes them. In the interest of space, I will not discuss
lines the methodology that I follow in this research. Sec- all dimensions. A detailed survey that describes these di-
tion 4 introduces a new computation model designed for dy- mensions in detail is being prepared for publication1 . This
namic graphs. Section 5 discusses existing data structures thesis focuses on dynamic algorithms for online and an-
in graph systems, and describes the success criteria for an alytical workloads on property graph(PG) models that
efficient dynamic graph processing. Finally, section 6 sum- represent fully dynamic [17] graphs. Grab’n Fix is orthog-
marizes my progress so far, and my future work. onal to existing computation models in the literature.

2. PROBLEM DEFINITION 3. METHODOLOGY


A graph, G is defined as G = (V, E), where V is a set of I intend to approach the research both algorithmically and
vertices and E is a set of edges, such that |V | = n, |E| = m. using a system-building approach. I develop dynamic algo-
For an edge e = (u, v, Pe ), e ∈ E if v, u ∈ V . Pe is a set rithms over large, dynamic graphs and incorporate these
of properties associated with edge e. A vertex v ∈ V , also, algorithms into a prototype system. Algorithmically, I con-
has a set of properties, Pv . Pe and Pv can be empty. Every sider optimization opportunities for future updates in a dy-
graph G may receive multiple updates ∆G. These updates namic graph (such as incremental processing). These al-
could be, insert, delete, or change. An ad-hoc query, such as gorithms will be incorporated into a parallel system over a
shortest path, or an analytical query, such as PageRank, can cluster environment to store and process large graph data.
be abstracted as a function F . The answer for this function My initial focus is on dynamic algorithms for three differ-
on the input graph G is F (G). ent analytical queries, Pagerank , APSP (All Pair Shortest
Existing graph processing systems have limited capabili- Path) [6], and Connected Component [18]. The common-
ties in utilizing previously computed answers F (G) to com- alities between these algorithms contributed in my design
pute the answer of F (G + ∆G) where ∆G represents the for the proposed computation model. These workloads are
change to the graph. For example, systems such as GraphLab [9, chosen, because each has a different challenge. For example,
14], Giraph [1], and Blogel [20] need to repartition the graph Pagerank can use precomputed ranks (before graph updates)
after every update, which is expensive. Moreover, some sys- as a heuristic during the re-computation phase. On the
tems (e.g., GraphLab) does not support edge deletions. other hand, APSP is a classic graph problem which builds
In this thesis, I am building algorithms and data struc- an N × N matrix to store the shortest distance between
tures implemented in a prototype system to efficiently com- each pair of vertices. The main objective is to answer short-
pute F (G+∆G). The objective is to compute the new result est path queries in constant time using this matrix. There
by only considering the graph changes, i.e.: have been significant effort made towards reducing the typi-
F (G + ∆G) = F (G) + F (∆G) (1) cal O(N 3 ) computation complexity of APSP; however, there
has not been much focus to reduce its O(N 2 ) memory re-
Ideally, F (G + ∆G) should be computed by only evalu- quirements. For large graphs, it is not feasible to build an
ating F (∆G) when a change occurs. However this is hard O(N 2 ) matrix in memory. Existing approaches to solve this
to achieve, since typically there is an overhead. Thus, the problem focus on incremental updates using native graph
formula is: algorithms on a single machine [2, 6, 17]; they either cannot
F (G + ∆G) = F (G) + F (∆G) +  (2) scale-out or cannot handle edge removals.
1
where  is the overhead. www.slideshare.net/MTamerOzsu/graph-lecture-58376147

8
Function Grab (vertex v, Adj-list graph G, result Function Grab (vertex v, Adj-list graph G, result
F (G), updates ∆G)) is F (G), updates ∆G)) is
Result: Intermediate state I Result: Intermediate state I
1 I ← G + ∆G // Include the whole graph in the 1 if v ∈ ∆G then
Intermediate state 2 if v ∈ add(u, v) then
2 return I 3 if F (v)! = F (u) then
Function Fix (Intermediate I, Adj-list graph G, result 4 if F (v) > F (u) then
F (G), updates ∆G)) is 5 I←v
Result: G0 , F (G0 ) 6 else
3 G0 ← G + ∆G 7 I←u
4 F (G0 ) ← CC(I) // Run the connected component
algorithm CC 8 if v ∈ del(u, v) or (v ∈ add(u, v) &
5 return G0 , F (G0 ) F (v) == F (u)) then
Algorithm 1: Static algorithm for Connected Component 9 if v.dist > u.dist then
considering vertex v ∈ G. 10 I←v
11 else
Recent research from Google [13, 18] proposed efficient 12 I←u
algorithms to find connected component. The implementa-
tion was presented for MapReduce and they show that in 13 return I
shared-environment this could be more efficient than other Algorithm 2: Dynamic algorithm for Connected Compo-
graph processing systems, such as Pregel [16]. The algo- nent considering vertex v ∈ G. The Fix function has been
rithms work with incremental growing dynamic graphs only, removed for the interest of the space. A vertex’s dist is the
ignoring 40% of the updates in the Twitter following graph maintained provenance information. It stores the distance
that are edge removals. Note that deleting an edge is signif- to the vertex with minimum id in the graph.
icantly harder than inserting an edge. For example, adding
an edge should always reduce the shortest path distance, or every vertex by the vertex id. As the algorithm iterates,
merge two components. On the other hand, edge removal vertices communicate with their neighbors their component
can split a graph or isolate a vertex. id. The component id of every vertex is the smallest vertex
An essential part of my research is building a controlled id that may reach this vertex. Therefore, the vertex with
experimental study for parallel graph systems. The main minimum id is called the graph representative.
objectives are two-fold: prepare a universal benchmark for In the Grab’n Fix model developers need to implement
future systematic evaluations, and evaluate existing systems two functions: Grab and Fix. The Grab stage receives the
in analyzing different types of graphs to find their shortcom- original graph G, its answer F (G) (along with any main-
ings and address them in my system. Therefore, I built a tained provenance information), and the updates ∆G. From
universal graph benchmark, Waterloo Graph Benchmark [3]. each graph entity’s perspective (for example from vertex per-
This is now being used in an extensive and systematic exper- spective) the Grab function describes how this entity can de-
imental study of graph analysis systems. This study includes cide if it should be part of the answer update process in the
systems from different computation models, such as vertex- Fix phase.
centric, block-centric, and map-reduce. I will also use the Algorithms 1 and 2 are both implemented using the Grab
same benchmark, and experimental framework to evaluate and Fix functions. The former acts as a static algorithm; for
the techniques that I develop as part of my PhD research. every update to the graph, the algorithm discards the pre-
vious answer and recomputes the connected component on
4. COMPUTATION MODEL the updated graph. The second algorithm reduces the inter-
mediate state (I) to vertices that might be influenced by the
The main requirement in dynamic algorithms is efficiently
graph update(∆G). If a vertex is involved in add-edge oper-
computing changes to a previously computed answer. In or-
ation, this means it might join a new component. Therefore,
der to help developers write efficient algorithms that mini-
the Grab function checks if the component for two vertices is
mize  in Equation 2, I propose a new graph computation
different, the vertex with larger component should be added
model specialized for dynamic graphs, which is orthogonal
to I. If the components are identical, the vertex with larger
to existing computing paradigms, such as Map-Reduce [5],
distance may have a chance to be closer, therefore it is also
vertex-centric [1, 16], and block-centric [20].
added to I. Note that Algorithm 2 is not complete. It does
The “Grab’n Fix” approach allows every entity in the
not include the Fix function for the interest of the space.
graph, such as a vertex, an edge, or a block, decide inde-
It also does not consider traversing the graph from a vertex
pendently whether or not it should be part of the overhead
that was added to I to find potential vertices that should be
(). Typically, to facilitate efficient dynamic computation,
considered because one of their neighbors was added to I.
it is required to store some information about the current
solution; I call this the provenance information. This is any
information used by the algorithm to compute F (G), but 5. GRAPH STORAGE
may help reduce the overhead in computing F (G+∆G). For It is common practice to keep all data in a “data lake’.
example, during the computation of the connected compo- This frequently means a distributed file system that can ac-
nent, every vertex may store the shortest path to the graph commodate a large dataset created by different data sources.
representative. Note that a common distributed connected A typical example for such a file system is Hadoop Dis-
component algorithm starts identifying the component of tributed File System (HDFS). HDFS creates replicas of data

9
blocks (typically of size 64MB) across the cluster for back Dataset (size in GB) 16 32 64 128
up and recovery purposes. Graph processing systems typi- Twitter (12.5) 191.5 323.6 606.4 923.5
cally process graphs in memory, and assume they are stored UK0705 (31.9) 264.0 411.8 717.6 1322.6
using text file formats on HDFS [1, 14, 19, 20]. For dynamic
graph processing, my system (Figure 1) challenges these as- Table 1: Giraph Memory consumption. All numbers are in
sumptions from three dimensions: the distributed storage, GB; first row shows cluster size.
in memory restriction, and data structures.
graph updates. Arrow is an in-memory column store that
5.1 Distributed Storage is compatible with multiple data stores (Parquet/HDFS,
Although HDFS has emerged as an industry standard for Kudu, Cassandra) and processing frameworks (Spark).
distributed storage, it has limitations:
5.2 Out-of-memory Computation
• It is not efficient in random reads.
Many distributed graph processing systems keep the graph
• Incremental updates to datasets are efficient, but decre-
in the cluster memory during computation. However, for
mental updates are not.
large real graphs, such as the web graph, this assumption is
• The storage space and computation power are associ-
hard to satisfy. My experiments show that most graph pro-
ated with each other.
cessing systems cannot store the ClueWeb5 , in the aggregate
There have been several attempts/alternatives to avoid memory of 3TB6 .
these limitations. For example, key-value stores, inspired by There have been a few attempts to utilize out-of-memory
Google BigTable [4], are distributed and fault tolerant, in computation in Giraph and GraphlabCreate. I advocate for
addition to being efficient with random reads and incremen- out-of-memory computation for multiple reasons:
tal/decremental update operation (using the key). Recently
1. The in-memory restriction was based on using HDFS
SnowFlake proposed an elastic data warehouse that replaces
as a distributed storage to avoid its inefficiency in pro-
HDFS by Amazon Simple Storage Service (S3)2 . S3 is a dis-
cessing random read/write requests.
tributed file system service. However, it is possible to use
2. The overhead of storing a graph in memory signifi-
one machine or thousands of machines to process the same
cantly increase as number of machines increases. This
amount of storage at S3. HDFS does not have this flexibility
overhead may overcome the benefit of in memory effi-
because the storage is distributed on the computing power,
ciency. Table 1 shows the total memory consumption
the machines. However, similar to key-value stores, S3 offers
by Giraph to process two real datasets: Twitter7 and
reading and writing data using their key, which is often a
UK07058 .
file name. File updates are not permitted. Finally, Cloudera
3. For large graphs, changes do not impact the whole
recently proposed Apache Kudu3 , a new distributed storage
dataset.
for fast analytics. It is trying to fill the gap between HDFS
efficiency in reading/writing large batch data, and key-value The proposed system utilizes local disks in the computa-
store efficiency in processing small ad-hoc queries. Kudu tion process, if necessary. Caching is essential for this set-
was designed to support large structured data; it has tables, ting; however, proposing algorithms for caching graph enti-
primary keys, and column types. ties (vertices, edges, etc) is beyond the scope of this thesis.
For dynamic graphs, HDFS cannot be the most efficient
option, because of the overhead of graph updates. Other 5.3 Data Structure
alternatives such as key-value stores, distributed column Graph systems adopt simple data structures for graph
stores (Vertica [12]), or a hybrid approach (Kudu) might processing, such as hash-map or Compressed Sparse Row
be interesting. However, since Kudu was designed for struc- (CSR). These standard representations are not efficient for
tured data and inspired by relational systems, we need to dynamic graph processing. Recently, LLAMA [15] proposed
introduce multiple modifications to efficiently support large a modified version of CSR to support graph updates and
graphs. My experiments show that column store systems, out-of-memory computation; however it is not distributed.
such as Vertica carry more overhead as the cluster scales out. The proposed system utilizes the unique capabilities of
In clusters larger than 16 machines, Vertica under-performs DiStinger [8], distributed data structure extension to Stinger [7].
several existing graph processing systems. Stinger is an efficient graph data structure built for dynamic
Existing systems consistently assume a text file format graphs and designed for a supercomputer (Cray XMT). In
(edge or adjacency list) because they read the graph data a nutshell, DiStinger’s master machine has summary infor-
once, then write the output after the computation finishes. mation about the graph, which helps directing queries to
However, text file format is inefficient. HDFS already has the right slave. Slaves have two main data structures: ver-
different file formats, such as Sequence, Avro, and Parquet tex array and edge array. Vertex array stores statistical
file format. Every format has different advantages and disad- information about each vertex, such as its degree. It has a
vantages based on the use case. Since column-store formats pointer to relevant edge block headers. Edge block headers
were shown to be efficient for graph processing [12], Parquet represent a linked list of edge blocks. Each edge block is as-
format has a great potential on top of HDFS.
5
The proposed system will utilize the column-store features http://law.di.unimi.it/webdata/clueweb12/
in Kudu and Apache Arrow4 to ensure fast processing for 6
My experiment cluster has 128 r3.xlarge amazon ma-
chines, each has 30 GB. Giraph [1], GraphLab [9], and
2
This work is accepted in SIGMOD 2016. GraphX [10] could not accommodate the graph in memory.
3 7
http://getkudu.io/overview.html http://law.di.unimi.it/webdata/twitter-2010
4 8
http://arrow.apache.org/ http://law.di.unimi.it/webdata/uk-2007-05/

10
sociated with group of edges, and stores information about [6] C. Demetrescu and G. F. Italiano. A new approach to
them, such as smallest and largest time stamp in the block. dynamic all pairs shortest paths. J. ACM,
DiStinger is a step towards an efficient distributed data 51(6):968–992, 2004.
structure for dynamic graph processing. However, it needs [7] D. Ediger, R. McColl, J. Riedy, and D. Bader. Stinger:
several modifications, such as augmenting DiStinger with High performance data structure for streaming graphs.
out-of-memory capabilities. This is going to reduce its mem- In IEEE Conference on High Performance Extreme
ory demand, and hopefully increase its efficiency. Computing, pages 1–5, 2012.
[8] G. Feng, X. Meng, and K. Ammar. Distinger: A
6. PROGRESS AND FUTURE WORK distributed graph data structure for massive dynamic
graph processing. In IEEE International Conference
I started my research by a comprehensive quantitative and
on Big Data, pages 1814–1822, 2015.
qualitative analysis for the distributed graph processing lit-
erature. Both studies are in the final stages. The quantita- [9] J. E. Gonzalez, Y. Low, H. Gu, D. Bickson, and
tive analysis is the first of its scope; it considers systems that C. Guestrin. Powergraph: Distributed graph-parallel
use different computation models to efficiently process static computation on natural graphs. In Proc. 10th
graphs. These systems were evaluated using different clus- USENIX Symp. on Operating System Design and
ter sizes (up to 128 machines), and multiple graph datasets Implementation, pages 17–30, 2012.
including the largest public web graph and road network [10] J. E. Gonzalez, R. S. Xin, A. Dave, D. Crankshaw,
graph. This wide-ranging experience grants me the ability M. J. Franklin, and I. Stoica. Graphx: Graph
to understand the existing shortcomings and empower my processing in a distributed dataflow framework. In
design decisions for the Grap’n Fix model and the proposed Proc. 11th USENIX Symp. on Operating System
architecture. Design and Implementation, pages 599–613, 2014.
This thesis extends three main components in my archi- [11] M. Han, K. Daudjee, K. Ammar, M. T. Ozsu,
tecture (Figure 1) to efficiently support dynamic graphs: X. Wang, and T. Jin. An experimental comparison of
pregel-like graph processing systems. Proc. VLDB
• Build a new graph processing system based on the Endowment, 7(12):1047–1058, 2014.
Grab’n Fix computation model. [12] A. Jindal, S. Madden, M. Castellanos, and M. Hsu.
• Extend DiStinger to interact with Apache Arrow and Graph analytics using vertica relational database. In
to optimize the amount of data in memory/local disk. IEEE International Conference on Big Data, pages
• Extend Kudu to support graph structures instead of 1191–1200, 2015.
relational data. [13] R. Kiveris, S. Lattanzi, V. Mirrokni, V. Rastogi, and
S. Vassilvitskii. Connected components in mapreduce
7. ACKNOWLEDGMENTS and beyond. In Proc. 5nd ACM Symp. on Cloud
Computing, pages 18:1–18:13, 2014.
I am indebted to my supervisor technical and personal
support. I am thankful for every faculty member and every [14] Y. Low, J. Gonzalez, A. Kyrola, D. Bickson,
graduate student; the weekly meetings in the Data Systems C. Guestrin, and J. M. Hellerstein. Distributed
Group at University of Waterloo are invaluable. In par- GraphLab: A framework for machine learning in the
ticular, I appreciate the feedback from Dr. Ihab Ilyas, Dr. cloud. Proc. VLDB Endowment, 5(8):716–727, 2012.
Khuzaima Daudjee, and Dr. Semih Salihoglu. This research [15] P. Macko, V. Marathe, D. Margo, and M. Seltzer.
is partially supported by Natural Sciences and Engineering LLAMA: Efficient graph analytics using large
Research Council (NSERC) of Canada, and IBM Center of multiversioned arrays. In Proc. of ICDE, pages
Advanced Research (CAS). 363–374, 2015.
[16] G. Malewicz, M. H. Austern, A. J. Bik, J. C. Dehnert,
I. Horn, N. Leiser, and G. Czajkowski. Pregel: a
8. REFERENCES system for large-scale graph processing. In Proc. ACM
[1] Giraph. http://giraph.apache.org. SIGMOD Int. Conf. on Management of Data, pages
[2] T. Akiba, Y. Iwata, and Y. Yoshida. Dynamic and 135–146, 2010.
historical shortest-path distance queries on large [17] J. Mondal and A. Deshpande. Managing large
evolving networks by pruned landmark labeling. pages dynamic graphs efficiently. In Proc. ACM SIGMOD
237–248, 2014. Int. Conf. on Management of Data, 2012.
[3] K. Ammar and M. Özsu. WGB: Towards a universal [18] V. Rastogi, A. Machanavajjhala, L. Chitnis, and
graph benchmark. In e. a. Rabl, Tilmann, editor, A. Das Sarma. Finding connected components in
Advancing Big Data Benchmarks, Lecture Notes in map-reduce in logarithmic rounds. In Proc. 29th Int.
Computer Science, pages 58–72. Springer, 2014. Conf. on Data Engineering, pages 50–61, April 2013.
[4] F. Chang, J. Dean, S. Ghemawat, W. Hsieh, [19] Y. Tian, A. Balmin, S. A. Corsten, S. Tatikonda, and
D. Wallach, M. Burrows, T. Chandra, A. Fikes, and J. McPherson. From “think like a vertex” to “think like
R. Gruber. Bigtable: A distributed storage system for a graph”. Proc. VLDB Endowment, 7(3):193–204,
structured data. ACM Trans. Comp. Syst., 2013.
26(2):Article 4, 2008. [20] D. Yan, J. Cheng, Y. Lu, and W. Ng. Blogel: A
[5] J. Dean and S. Ghemawat. MapReduce: Simplified block-centric framework for distributed computation
data processing on large clusters. In Proc. 6th on real-world graphs. Proc. VLDB Endowment,
USENIX Symp. on Operating System Design and 7(14):1981–1992, 2014.
Implementation, pages 137–149, 2004.

11

You might also like