Vertica: Challenging the "Graph vs. SQL" Myth with Columnar Power
Scalable Social Graph Analytics Using the Vertica Analytic Platform
The paper presents a high-performance approach to Social Graph Analytics using the Vertica Analytic Database, challenging the common belief that relational databases are unsuitable for graph problems. It demonstrates SOTA performance in influencer identification and triangle counting, outperforming Hadoop and Pig by up to 40x.
TL;DR
For years, the industry consensus has been that if you have a graph problem, you shouldn't use a relational database. This paper from the Vertica team dismantles that notion. By utilizing column-oriented storage, pipelined execution, and aggressive compression, Vertica outperforms Hadoop and Pig by orders of magnitude (up to 40x) on classic graph tasks like triangle counting and influencer identification.
The Misconception: Why We Fled to MapReduce
The "Web 2.0" explosion necessitated graph analytics—calculating churn, viral coefficients, and finding influencers. Most practitioners shifted to MapReduce (Hadoop) or specialized engines because standard RDBMS row-stores struggled with the recursive, join-heavy nature of graph queries.
The authors argue this wasn't a failure of SQL, but a failure of traditional row-based architectures. MapReduce, while scalable, introduces significant "taxation" in the form of:
- Extensive I/O: Constant writing of intermediate results to disk between Map and Reduce phases.
- High Memory Overhead: Frequent Java heap allocations/deallocations.
- Complexity: The need for manual join-order tuning and procedural coding.
Methodology: The Core Architecture
The secret to Vertica’s success in this space lies in three pillars:
- Columnar Storage & RLE: By storing data by column and using Run-Length Encoding, Vertica reduces the data footprint significantly. In the paper's experiment, a 1.3GB raw graph was compressed to 560MB while maintaining high-speed access.
- Fully Pipelined Execution: Unlike Hadoop, which treats each step as a discrete job, Vertica streams data through different operators in memory, avoiding the "stop-and-copy" overhead.
- Vectorized Joins: Vertica performs joins and predicate evaluations on encoded data in batches (vectors), utilizing CPU caches much more effectively than record-at-a-time processing.
Algorithm Breakdown: K-Core Decomposition
To find influencers, the authors implemented the K-Core algorithm. Instead of writing complex Java code, they utilized iterative SQL:
- The Logic: Repeatedly prune nodes with a degree less than k.
- The SQL: A simple
INSERT INTO ... SELECT ... WHERE src NOT IN (SELECT src FROM low_degree_nodes).
Figure 1: The relational schema used for transforming social interactions into graph edges.
Experimental Showdown: Vertica vs. The Giants
The authors pitted Vertica against Hadoop and Pig using the LiveJournal social network graph (86 million edges).
Performance comparison: Triangle Counting
Triangle counting is the gold standard for testing graph "join" performance. It requires a 3-way self-join of the edge table.
Figure 2: Execution time comparison. Vertica finishes in seconds where Hadoop takes minutes.
Key Findings:
- Speed: Vertica was 40x faster than Hadoop and 22x faster than Pig.
- Disk Efficiency: Vertica's peak disk usage was a fraction of Hadoop’s, largely because it doesn't need to materialize massive intermediate join results to HDFS.
- Ease of Use: The SQL optimizer automatically handled join ordering, whereas Pig required manual tuning to avoid 1.5x performance penalties.
Deep Insight: Why Not specialized Graph DBs?
While the paper focuses on the RDBMS vs. MapReduce battle, the underlying message is about convergence. If a database engine is fast enough at joins and supports iterative logic, the benefits of a "standard" SQL environment—ACID compliance, ecosystem integration, and familiar syntax—outweigh the niche benefits of a dedicated graph engine for many use cases.
Conclusion & Limitations
Vertica proves that it can handle graphs with hundreds of millions of edges in real-time. However, the paper primarily addresses algorithms that can be expressed as relational algebra (joins/filters). For algorithms requiring deep recursion or complex path-finding (like exact All-Pairs Shortest Path on very sparse graphs), the SQL translation might become more cumbersome than a vertex-centric approach.
Final Takeaway: Before migrating your graph workload to a complex Hadoop/Spark ecosystem or a specialized Neo4j instance, check if your modern Analytic Data Warehouse can solve it with a simple JOIN.
