A Scalable Data Structure for Efficient Graph Analytics and In-Place Mutations
Abstract
:1. Introduction
- CSR++, a new graph data structure that supports fast in-place updates without sacrificing read-only performance or memory consumption.
- Our thorough evaluation that shows that CSR++ achieves the best of both read-only and update-friendly worlds.
- An in-depth analysis of the design space, regarding memory allocation, segment size, and synchronization mechanisms, to further improve the read and update performance of CSR++.
2. Background and Related Work
2.1. Graph Representations
2.1.1. Adjacency Matrices and Lists
2.1.2. Compressed Sparse Row (CSR)
2.2. Graph Mutations
2.2.1. In-Place Updates
2.2.2. Batching
2.2.3. Multi-Versioning and Deltas
3. CSR++: Design and Implementation
3.1. Graph Topology and Properties
3.1.1. Segments
3.1.2. Vertices
- length (4 bytes): The vertex degree. A length of −1 indicates a deleted vertex.
- neighbors (8 bytes): A pointer to the set of neighbors. As a space optimization feature, if length = 1, this field directly contains the neighbor’s vertex ID.
- edge_properties (8 bytes): A pointer to the set of edge properties. As a space optimization feature, this field can be disabled in case the graph does not define edge properties.
3.1.3. Edges
- deleted_flag (2 bytes): For logical deletion of edges.
- vertex_id (2 bytes): The index of the neighbor in the segment; using 16 bits allows for segments with a capacity NUM_V_SEG of up to 65,536 entries.
- segment_id (4 bytes): The segment ID where the neighbor is stored.
3.1.4. Properties
3.1.5. Additional Structures
3.1.6. Synchronization
3.2. Update Protocols
3.2.1. Vertex and Edge Insertion
- Group the edges by their source vertices and convert both source and destination user keys to internal keys. The new vertices are inserted in CSR++, where each acquires a new internal ID. Keep this step sequential in CSR++, as it is very lightweight (see Section 4.7).
- Sort the new edges (parallel for each source vertex); then, insert them into the direct and reverse maps (also parallel for each source vertex).
- Sort the final edge arrays using a technique that merges two sorted arrays (i.e., the old edges and the new ones) and reallocate the edge properties (parallel for each modified segment) according to the new order of edges.
3.2.2. Vertex and Edge Deletion
3.3. Algorithms on Top of CSR++
4. Evaluation
- How does CSR++ perform with read-only and with update workloads?
- How much memory does CSR++ consume with these workloads?
4.1. Experimental Methodology
4.2. Sensitivity Analysis: Segment Size
4.3. Sensitivity Analysis: Improving Update Performance with HTM
4.4. Sensitivity Analysis: Memory Allocators
4.5. Read-Only: Algorithms
4.6. Read-Only: Sequential and Random Scans
4.7. Updates: Vertex Insertions
4.8. Updates: Batch Edge Insertions
4.9. Updates: Edge Insertions with Properties
4.10. Updates: Memory Consumption
4.11. Updates: Edge Deletions
4.12. Analytics after Graph Updates
4.13. Memory Footprint
5. Concluding Remarks
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
1 | This article extends the OPODIS ’20 Conference publication by Firmli et al. [26] with (i) a more in-depth analysis of CSR++ in terms of design and performance; (ii) a sensitivity analysis of different design parameters, namely, the segment sizes in CSR++, the use of different memory allocators, and synchronization with Intel’s Hardware Transactional Memory (HTM); and (iii) an extended performance evaluation, which compares CSR++’s performance to that of three more graph data structures, namely, GraphOne [22], Teseo [24], and STINGER [23], and includes a new set of experiments from an external graph update benchmark framework, the GFE driver [27], as well as new data sets. |
2 | CSR++ can support growing factors different from to enable the tuning of edge insertion and memory consumption performance. |
References
- Dhulipala, L.; Blelloch, G.; Shun, J. Julienne: A Framework for Parallel Graph Algorithms Using Work-efficient Bucketing. In Proceedings of the SPAA, New York, NY, USA, 24–26 July 2017. [Google Scholar]
- Haubenschild, M.; Then, M.; Hong, S.; Chafi, H. ASGraph: A Mutable Multi-versioned Graph Container with High Analytical Performance. In Proceedings of the GRADES, New York, NY, USA, 24 June 2016. [Google Scholar]
- Macko, P.; Marathe, V.J.; Margo, D.W.; Seltzer, M.I. LLAMA: Efficient Graph Analytics Using Large Multiversioned Arrays. In Proceedings of the ICDE, Seoul, Republic of Korea, 13–17 April 2015. [Google Scholar]
- Sevenich, M.; Hong, S.; van Rest, O.; Wu, Z.; Banerjee, J.; Chafi, H. Using Domain-specific Languages for Analytic Graph Databases. Proc. VLDB Endow. 2016, 9, 1257–1268. [Google Scholar] [CrossRef]
- Shun, J.; Blelloch, G.E. Ligra: A Lightweight Graph Processing Framework For Shared Memory. In Proceedings of the PPoPP, Shenzhen, China, 23–27 February 2013. [Google Scholar]
- Zhang, K.; Chen, R.; Chen, H. NUMA-Aware Graph-Structured Analytics. In Proceedings of the PPoPP, San Francisco, CA, USA, 7–11 February 2015. [Google Scholar]
- Page, L.; Brin, S.; Motwani, R.; Winograd, T. The PagerRank Citation Ranking: Bringing Order to the Web; Technical Report; Stanford InfoLab: Stanford, CA, USA, 1999. [Google Scholar]
- Dias, V.; Teixeira, C.H.C.; Guedes, D.; Meira, W.; Parthasarathy, S. Fractal: A General-Purpose Graph Pattern Mining System. In Proceedings of the SIGMOD, Amsterdam, The Netherlands, 30 June–5 July 2019. [Google Scholar]
- Kankanamge, C.; Sahu, S.; Mhedbhi, A.; Chen, J.; Salihoglu, S. Graphflow: An Active Graph Database. In Proceedings of the SIGMOD, Chicago, IL, USA, 14–19 May 2017. [Google Scholar]
- Mawhirter, D.; Wu, B. AutoMine: Harmonizing High-level Abstraction and High Performance for Graph Mining. In Proceedings of the SOSP, Huntsville, ON, Canada, 27–30 October 2019. [Google Scholar]
- Neo4j. Available online: http://www.neo4j.org (accessed on 2 November 2023).
- Raman, R.; van Rest, O.; Hong, S.; Wu, Z.; Chafi, H.; Banerjee, J. PGX.ISO: Parallel and Efficient In-memory Engine for Subgraph Isomorphism. In Proceedings of the GRADES, Snowbird, UT, USA, 22–27 June 2014. [Google Scholar]
- Sakr, S.; Elnikety, S.; He, Y. G-SPARQL: A Hybrid Engine for Querying Large Attributed Graphs. In Proceedings of the ACM CIKM, Maui, HI, USA, 29 October–2 November 2012. [Google Scholar]
- van Rest, O.; Hong, S.; Kim, J.; Meng, X.; Chafi, H. PGQL: A Property Graph Query Language. In Proceedings of the GRADES, Redwood Shores, CA, USA, 24 June 2016. [Google Scholar]
- PGQL: Property Graph Query Language. Available online: http://pgql-lang.org/ (accessed on 2 November 2023).
- Firmli, S.; Chiadmi, D. A Review of Engines for Graph Storage and Mutations. In Proceedings of the EMENA-ISTL, Marrakesh, Morocco, 6–8 January 2020. [Google Scholar]
- Staudt, C.L.; Sazonovs, A.; Meyerhenke, H. NetworKit: A Tool Suite For Large-Scale Complex Network Analysis. Netw. Sci. 2016, 4, 508–530. [Google Scholar] [CrossRef]
- Wheatman, B.; Xu, H. Packed Compressed Sparse Row: A Dynamic Graph Representation. In Proceedings of the HPEC, Waltham, MA, USA, 25–27 September 2018. [Google Scholar]
- Cheng, R.; Chen, E.; Hong, J.; Kyrola, A.; Miao, Y.; Weng, X.; Wu, M.; Yang, F.; Zhou, L.; Zhao, F. Kineograph: Taking the Pulse of a Fast-changing and Connected World. In Proceedings of the EuroSys, Bern, Switzerland, 10–13 April 2012. [Google Scholar]
- Madduri, K.; Bader, D.A. Compact Graph Representations and Parallel Connectivity Algorithms for Massive Dynamic Network Analysis. In Proceedings of the IPDPS, Rome, Italy, 23–29 May 2009. [Google Scholar]
- Kyrola, A.; Blelloch, G.; Guestrin, C. GraphChi: Large-Scale Graph Computation on Just a PC. In Proceedings of the OSDI, Hollywood, CA, USA, 8–10 October 2012. [Google Scholar]
- Kumar, P.; Huang, H.H. GraphOne: A Data Store for Real-Time Analytics on Evolving Graphs. ACM Trans. Storage 2020, 15, 29. [Google Scholar] [CrossRef]
- Ediger, D.; McColl, R.; Riedy, J.; Bader, D.A. STINGER: High performance data structure for streaming graphs. In Proceedings of the HPEC, Waltham, MA, USA, 10–12 September 2012. [Google Scholar] [CrossRef]
- De Leo, D.; Boncz, P. Teseo and the Analysis of Structural Dynamic Graphs. Proc. VLDB Endow. 2021, 14, 1053–1066. [Google Scholar] [CrossRef]
- Bender, M.A.; Demaine, E.D.; Farach-Colton, M. Cache-Oblivious B-Trees. SIAM J. Comput. 2005, 35, 341–358. [Google Scholar] [CrossRef]
- Firmli, S.; Trigonakis, V.; Lozi, J.P.; Psaroudakis, I.; Weld, A.; Chiadmi, D.; Hong, S.; Chafi, H. CSR++: A Fast, Scalable, Update-Friendly Graph Data Structure. In Proceedings of the OPODIS, Strasbourg, France, 13–15 December 2021. [Google Scholar]
- GFE Driver Code. Available online: https://github.com/cwida/gfe_driver (accessed on 2 November 2023).
- Gartner Top 10 Data and Analytics Trends for 2019. Available online: https://www.gartner.com/smarterwithgartner/gartner-top-10-data-analytics-trends/ (accessed on 2 November 2023).
- Sun, W.; Fokoue, A.; Srinivas, K.; Kementsietsidis, A.; Hu, G.; Xie, G.T. SQLGraph: An Efficient Relational-Based Property Graph Store. In Proceedings of the SIGMOD, Melbourne, VIC, Australia, 31 May–4 June 2015. [Google Scholar]
- Hong, S.; Chafi, H.; Sedlar, E.; Olukotun, K. Green-Marl: A DSL for Easy and Efficient Graph Analysis. In Proceedings of the ASPLOS, London, UK, 3–7 March 2012. [Google Scholar]
- SPARQL Query Language for RDF. Available online: http://www.w3.org/TR/rdf-sparql-query/ (accessed on 2 November 2023).
- Tinkerpop, Gremlin. Available online: https://github.com/tinkerpop/gremlin/wiki (accessed on 2 November 2023).
- Bratsas, C.; Chondrokostas, E.; Koupidis, K.; Antoniou, I. The Use of National Strategic Reference Framework Data in Knowledge Graphs and Data Mining to Identify Red Flags. Data 2021, 6, 2. [Google Scholar] [CrossRef]
- Berners-Lee, T.; Hendler, J.; Lassila, O. The Semantic Web. Sci. Am. 2001, 284, 34–43. [Google Scholar] [CrossRef]
- Zeng, K.; Yang, J.; Wang, H.; Shao, B.; Wang, Z. A Distributed Graph Engine for Web Scale RDF Data. Proc. VLDB Endow. 2013, 6, 265–276. [Google Scholar] [CrossRef]
- Property Graph Model. Available online: https://github.com/tinkerpop/blueprints/wiki/Property-Graph-Model (accessed on 2 November 2023).
- Oracle Parallel Graph AnalytiX (PGX). Available online: https://www.oracle.com/middleware/technologies/parallel-graph-analytix.html (accessed on 2 November 2023).
- Hong, S.; Depner, S.; Manhardt, T.; van der Lugt, J.; Verstraaten, M.; Chafi, H. PGX.D: A Fast Distributed Graph Processing Engine. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, Austin, TX, USA, 15–20 November 2015. [Google Scholar]
- Trigonakis, V.; Lozi, J.P.; Faltín, T.; Roth, N.P.; Psaroudakis, I.; Delamare, A.; Haprian, V.; Iorgulescu, C.; Koupy, P.; Lee, J.; et al. aDFS: An Almost Depth-First-Search Distributed Graph-Querying System. In Proceedings of the 2021 USENIX Annual Technical Conference (USENIX ATC 21), Online, 14–16 July 2021; USENIX Association: Berkeley, CA, USA, 2021; pp. 209–224. [Google Scholar]
- Roth, N.P.; Trigonakis, V.; Hong, S.; Chafi, H.; Potter, A.; Motik, B.; Horrocks, I. PGX.D/Async: A Scalable Distributed Graph Pattern Matching Engine. In Proceedings of the GRADES, Chicago, IL, USA, 14–19 May 2017. [Google Scholar]
- Mariappan, M.; Vora, K. GraphBolt: Dependency-Driven Synchronous Processing of Streaming Graphs. In Proceedings of the EuroSys, Dresden, Germany, 25–28 March 2019. [Google Scholar]
- Ediger, D.; Riedy, J.; Bader, D.A.; Meyerhenke, H. Tracking structure of streaming social networks. In Proceedings of the IPDPSW, Anchorage, AK, USA, 16–20 May 2011. [Google Scholar]
- Boost Adjacency List Documentation. Available online: https://www.boost.org/doc/libs/1_67_0/libs/graph/doc/adjacency_list.html (accessed on 2 November 2023).
- Besta, M.; Fischer, M.; Kalavri, V.; Kapralov, M.; Hoefler, T. Practice of Streaming and Dynamic Graphs: Concepts, Models, Systems, and Parallelism. arXiv 2019, arXiv:1912.12740. [Google Scholar]
- Kallimanis, N.D.; Kanellou, E. Wait-free concurrent graph objects with dynamic traversals. In Proceedings of the OPODIS, Madrid, Spain, 13–16 December 2016. [Google Scholar]
- Busato, F.; Green, O.; Bombieri, N.; Bader, D.A. Hornet: An Efficient Data Structure for Dynamic Sparse Graphs and Matrices on GPUs. In Proceedings of the HPEC, Waltham, MA, USA, 25–27 September 2018. [Google Scholar] [CrossRef]
- Feng, G.; Meng, X.; Ammar, K. DISTINGER: A distributed graph data structure for massive dynamic graph processing. In Proceedings of the IEEE Big Data, Santa Clara, CA, USA, 29 October–1 November 2015. [Google Scholar] [CrossRef]
- Green, O.; Bader, D.A. cuSTINGER: Supporting Dynamic Graph Algorithms for GPUs. In Proceedings of the HPEC, Westin Hotel, Waltham, MA, USA, 13–15 September 2016. [Google Scholar] [CrossRef]
- Wheatman, B.; Xu, H. A Parallel Packed Memory Array to Store Dynamic Graphs. In Proceedings of the 2021 Proceedings of the Symposium on Algorithm Engineering and Experiments (ALENEX), Virtual, 10–11 January 2021; pp. 31–45. [Google Scholar] [CrossRef]
- Besta, M.; Hoefler, T. Accelerating Irregular Computations with Hardware Transactional Memory and Active Messages. In Proceedings of the 24th International Symposium on High-Performance Parallel and Distributed Computing, Portland, OR, USA, 15–19 June 2015. [Google Scholar]
- Herlihy, M.; Moss, J.E.B. Transactional Memory: Architectural Support for Lock-Free Data Structures. In Proceedings of the 1993, ISCA ’93, San Diego, CA, USA, 16–19 May 1993. [Google Scholar] [CrossRef]
- Paradies, M.; Lehner, W.; Bornhövd, C. GRAPHITE: An Extensible Graph Traversal Framework for Relational Database Management Systems. In Proceedings of the SSDBM, La Jolla, CA, USA, 29 June–1 July 2015. [Google Scholar]
- Green-Marl Code. Available online: https://github.com/stanford-ppl/Green-Marl (accessed on 2 November 2023).
- Falsafi, B.; Guerraoui, R.; Picorel, J.; Trigonakis, V. Unlocking Energy. In Proceedings of the USENIX ATC, Denver, CO, USA, 20–21 June 2016. [Google Scholar]
- OpenMP. Available online: https://www.openmp.org (accessed on 2 November 2023).
- Iosup, A.; Hegeman, T.; Ngai, W.L.; Heldens, S.; Prat-Pérez, A.; Manhardto, T.; Chafio, H.; Capotă, M.; Sundaram, N.; Anderson, M.; et al. LDBC Graphalytics: A Benchmark for Large-Scale Graph Analysis on Parallel and Distributed Platforms. Proc. VLDB Endow. 2016, 9, 1317–1328. [Google Scholar] [CrossRef]
- LLAMA Code. Available online: https://github.com/goatdb/llama (accessed on 2 November 2023).
- David, T.; Guerraoui, R.; Trigonakis, V. Everything You Always Wanted to Know about Synchronization but Were Afraid to Ask. In Proceedings of the SOSP ’13, Twenty-Fourth ACM Symposium on Operating Systems Principles, Farmington, PA, USA, 3–6 November 2013; Association for Computing Machinery: New York, NY, USA, 2013; pp. 33–48. [Google Scholar] [CrossRef]
- Evans, J. A Scalable Concurrent malloc(3) Implementation for FreeBSD. In Proceedings of the BSDCan, Ottawa, ON, Canada, 16 April 2006. [Google Scholar]
- Hunter, A.H.; Kennelly, C.; Gove, D.; Ranganathan, P.; Turner, P.J.; Moseley, T.J. Beyond malloc efficiency to fleet efficiency: A hugepage-aware memory allocator. In Proceedings of the OSDI, Online, 14–16 July 2021. [Google Scholar]
Data Set | #Vertices | #Edges | Source |
---|---|---|---|
41 million | 1.4 billion | Real-world graph | |
LiveJournal | 4.8 million | 68 million | Real-world graph |
Graph500-22 | 2.3 million | 64 million | Synthetic graph |
Uniform-24 | 8 million | 260 million | Synthetic graph |
Name | Type | Configuration |
---|---|---|
CSR++ | Segmentation-based | Pre-allocated extra space for new edges. Deletion support enabled only with deletion workloads, in order to have a fair comparison with LLAMA, which does not support deletions by default. |
BGL [43] | AL | Bidirectional with default parameters. |
CSR [53] | CSR | Implementation in the Green-Marl library [53]. |
LLAMA [57] | CSR with delta logs | Read- and space-optimized with explicit linking. The fastest overall variant of LLAMA. Deletion support enabled only with deletion workloads. |
STINGER [23] | Blocked AL | Linked list of blocks storing up to 14 edges. |
GraphOne [22] | Multi-level AL and circular-edge log | Ignored archiving phase. |
Teseo [24] | Transactional Fat Tree based on PMA | Asynchronous rebalances delayed to 200 ms and 1 MB maximum leaf capacity. |
Algorithm | Description |
---|---|
PR | Computes ranking scores for vertices based on their incoming edges. |
Weakly Connected Components (WCCs) | Computes affinity of vertices within a network. |
Breadth-First Search (BFS) | Traverses the graph starting from a root vertex; visits neighbors; and stores the distance of vertices from the root vertex, as well as parents. |
Weighted PR | Computes ranking scores like the original PR but with weights and allows for a weight associated with every edge. It requires accesses to edge properties. |
Segment Size | 8 | 32 | 128 | 512 | 1024 | 2048 | 4096 | 16,384 | 32,768 |
Memory overhead in bytes | 869,616 | 217,368 | 54,288 | 13,536 | 6768 | 3384 | 1656 | 360 | 144 |
#Vertices | 10 K | 100 K | 1 M | 10 M |
---|---|---|---|---|
Time (ms)—0 vertex properties | 1.6 | 11 | 120 | 1188 |
Time (ms)—50 vertex properties | 10 | 32 | 181 | 1259 |
Graph Structure | LiveJournal | Twitter-12 | Twitter-20 | Twitter-100 | |
---|---|---|---|---|---|
CSR | 0.53 | 11.09 | 11.09 | 11.09 | 11.09 |
CSR++ read-only | 0.57 | 11.54 | - | - | - |
CSR++ | 0.82 | 16.55 | 16.55 | 16.55 | 16.55 |
LLAMA | 0.58 | 11.56 | 21.66 | 27.03 | 78.00 |
LLAMA implicit linking | 0.58 | 11.56 | 19.02 | 23.99 | 73.64 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Firmli, S.; Chiadmi, D. A Scalable Data Structure for Efficient Graph Analytics and In-Place Mutations. Data 2023, 8, 166. https://doi.org/10.3390/data8110166
Firmli S, Chiadmi D. A Scalable Data Structure for Efficient Graph Analytics and In-Place Mutations. Data. 2023; 8(11):166. https://doi.org/10.3390/data8110166
Chicago/Turabian StyleFirmli, Soukaina, and Dalila Chiadmi. 2023. "A Scalable Data Structure for Efficient Graph Analytics and In-Place Mutations" Data 8, no. 11: 166. https://doi.org/10.3390/data8110166