LSMGraph: A High-Performance Dynamic Graph Storage System with Multi-Level CSR

Song Yu, Shufeng Gong, Qian Tao, Sijie Shen, Yanfeng Zhang, Wenyuan Yu, Pengxi Liu, Zhixin Zhang, Hongfu Li, Xiaojian Luo, Ge Yu, Jingren Zhou

TL;DR

LSMGraph is a specialized disk-based storage engine that solves the "read-write dilemma" in dynamic graph processing by embedding Compressed Sparse Row (CSR) structures within a multi-level Log-Structured Merge-tree (LSM-tree). By making the storage "graph-aware," it achieves massive speedups—up to 50x for updates and 30x for analysis—compared to general-purpose and state-of-the-art graph systems.

What Problem Does This Paper Address?

Modern graph data (like user behaviors on Alibaba's Taobao) is massive, dynamic, and often exceeds the capacity of main memory. This necessitates disk-based storage. However, existing systems face a fundamental trade-off:

  1. Write-friendly systems (like LSM-trees/RocksDB) treat edges as independent key-value pairs. This allows for fast sequential writes but destroys "read locality," as a single vertex's neighbors end up scattered across different disk blocks.
  2. Read-friendly systems (using CSR) store neighbors contiguously for lightning-fast traversal. However, CSR is notoriously difficult to update; adding a single edge often requires shifting large amounts of existing data to maintain compactness, leading to "write amplification."
Example graph and its corresponding Compressed Sparse Row (CSR) representation.

LSMGraph aims to provide the best of both worlds: the high ingestion rate of LSM-trees and the high-performance traversal of CSR.

Methods

The authors introduce three core architectural innovations to bridge the gap between LSM-trees and CSR:

Overview of the LSMGraph storage system architecture.
  • MemGraph: A hybrid memory cache. Recognizing that graph degrees follow a power-law distribution, MemGraph uses a hashmap for lookups combined with two structures: a simple array for low-degree vertices and a skip list for high-degree vertices. This avoids expensive data movement during updates.
  • Multi-Level CSR: On disk, LSMGraph organizes data into levels similar to an LSM-tree. However, instead of generic data blocks, each level contains segments stored in a specialized CSR format. During "compaction" (the process of merging levels), the system performs a vertex-aware merge to ensure all edges for a specific vertex remain contiguous within that level.
  • Multi-Level Index: To avoid the "read amplification" common in LSM-trees, LSMGraph maintains a global index. This index directly points to the file ID and offset for a vertex's edges across all levels, turning a search problem into a direct lookup.
  • Vertex-Grained Version Control: To support concurrent reads and writes without massive locking overhead, the system uses a fine-grained versioning mechanism. It allows analytical queries to see a consistent snapshot of a vertex even while background compactions are moving data.

Datasets

The system was evaluated using four massive, real-world datasets:

  • Web Graphs: IT-2004 (1.1B edges) and UK-2007 (3.3B edges).
  • Social Networks: Twitter (1.4B edges) and Friendster (2.5B edges).

The evaluation compared LSMGraph against LiveGraph, LLAMA, RocksDB, and MBFGraph on an AliCloud environment with SSD storage.

Key Insights and Ideas

  • Graph-Aware Compaction: The "aha moment" is that the background compaction process of an LSM-tree is the perfect time to reorganize graph data into CSR format. By moving the "cost" of CSR maintenance to an asynchronous background task, the system hides write latency from the user.
  • Exploiting Power-Laws: By tailoring the memory structure (MemGraph) to the reality of graph topology, the authors minimize memory management overhead. Most vertices never outgrow their small array segments, while skip lists gracefully handle the heavy hitters.
  • Index-Driven Locality: Standard LSM-trees rely on Bloom filters to guess if data exists in a block. LSMGraph’s multi-level index provides a deterministic map, which is crucial for graph algorithms that frequently traverse "neighbor-of-neighbor" relationships.

Key Results

LSMGraph demonstrates dominant performance across the board:

  • Graph Updates: It achieved an average speedup of 36.12× over LiveGraph, 2.85× over LLAMA, and 8.07× over RocksDB.
  • Graph Analysis: For algorithms like PageRank, SSSP, and BFS, it was 24.4× faster than LiveGraph and 30.8× faster than RocksDB.
  • Space Efficiency: LSMGraph is significantly more compact than its competitors, using only 45% of the space required by LiveGraph and 24% of that required by LLAMA, thanks to its efficient CSR-based disk format and versioning strategy.

Limitations and Future Work

While the system optimizes read-write concurrency, simultaneous writes to the same vertex still require vertex-grained locks in the MemGraph, which could be a bottleneck for extremely skewed update workloads. Additionally, the paper focuses heavily on topology; the performance impact of frequent, large property updates (vs. simple topology changes) is less explored. Finally, extending the "Multi-Level CSR" concept to a distributed architecture where vertices are partitioned across a cluster is a promising but unaddressed direction.

Summary updated

BibTeX
@inproceedings{yu2024lsmgraph,
  author = {Song Yu and Shufeng Gong and Qian Tao and Sijie Shen and Yanfeng Zhang and Wenyuan Yu and Pengxi Liu and Zhixin Zhang and Hongfu Li and Xiaojian Luo and Ge Yu and Jingren Zhou},
  title = {{LSMGraph: A High-Performance Dynamic Graph Storage System with Multi-Level CSR}},
  booktitle = {Proc. ACM Manag. Data},
  year = {2024},
  url = {https://openreview.net/forum?id=p4tvMwiHK8},
}
Figure