Greenplum: A Hybrid Database for Transactional and Analytical Workloads

Zhenghua Lyu, Huan Hubert Zhang, Gang Xiong, Gang Guo, Haozhou Wang, Jinbao Chen, Asim Praveen, Yu Yang, Xiaoming Gao, Alexandra Wang, Wen Lin, Ashwin Agrawal, Junfeng Yang, Hao Wu, Xiaoliang Li, Feng Guo, Jiang Wu, Jesse Zhang, Venkatesh Raghavan

Abstract

Greenplum, traditionally a powerhouse for Online Analytical Processing (OLAP), has evolved into a robust Hybrid Transactional and Analytical Processing (HTAP) system. By addressing "concurrency killers" such as restrictive locking and expensive commit protocols, Greenplum 6 achieves up to 80x the transactional throughput of its predecessor. This paper details the architectural innovations—including a global deadlock detector and one-phase commit optimizations—that allow a Massively Parallel Processing (MPP) database to excel in both transactional and analytical arenas.

Introduction: The HTAP Challenge

Historically, organizations have maintained separate systems for Online Transactional Processing (OLTP) and OLAP. This separation necessitates complex ETL (Extract, Transform, Load) pipelines, introducing data latency and operational overhead. Greenplum was originally designed as an OLAP-first system, utilizing heavy table-level exclusive locks to avoid distributed deadlocks. However, this approach severely limited concurrency, as shown in the exponential rise of locking overhead with increased connections.

Impact of locking overhead on total execution time as connection count increases.

To transform Greenplum into an HTAP system, the researchers focused on lowering these barriers to allow high-concurrency transactions without sacrificing ACID properties.

Architectural Innovations

The transition to HTAP was driven by three core architectural upgrades:

  1. Global Deadlock Detector (GDD): Greenplum now permits lower-level locks (RowExclusive) instead of table-level locks. A background daemon periodically analyzes "wait-for" graphs across all segments to identify and resolve global deadlock cycles using a greedy algorithm.
  2. One-Phase Commit (1PC) Optimization: For transactions affecting only a single segment—a frequent pattern in OLTP—the system bypasses the standard Two-Phase Commit (2PC) "PREPARE" phase. This reduces network round-trips and disk syncs, significantly lowering latency.
  3. Resource Isolation: To prevent resource-heavy analytical queries from impacting transactional performance, the system utilizes Linux cgroups for CPU isolation and a custom Vmemtracker for memory management.

Polymorphic Storage and Data Management

A key advantage of Greenplum’s architecture is its support for polymorphic storage. This allows a single partitioned table to contain "hot" data in row-oriented heap tables (optimized for updates/deletes) and "cold" data in columnar or external formats (optimized for compression and analytical scans).

Greenplum's polymorphic storage allows mixing row-oriented, column-oriented, and external data formats.

Evaluation and Key Results

The system was evaluated using industry-standard benchmarks including TPC-B and the CH-benCHmark. Key findings include:

  • Throughput: Greenplum 6 demonstrated an 80x increase in transactions per second compared to Greenplum 5 at high concurrency (100+ connections).
  • Latency: The 1PC optimization improved single-segment insert speeds by 5x.
  • Isolation: Resource Groups reduced transactional latency by 3x under mixed workloads by pinning specific CPU resources for OLTP tasks.
  • Scalability: Throughput remained steady even as data volumes scaled to 1.4TB, outperforming standard PostgreSQL in large-scale scenarios.

Conclusion and Future Directions

Greenplum's evolution proves that MPP databases can effectively handle hybrid workloads. While significant gains have been made, future work will address coordinator bottlenecks through multi-master features and improve I/O isolation. The ultimate goal is a fully autonomous system capable of dynamic resource tuning based on real-time traffic patterns.

Summary updated

BibTeX
@inproceedings{lyu2021greenplum,
  author = {Zhenghua Lyu and Huan Hubert Zhang and Gang Xiong and Gang Guo and Haozhou Wang and Jinbao Chen and Asim Praveen and Yu Yang and Xiaoming Gao and Alexandra Wang and Wen Lin and Ashwin Agrawal and Junfeng Yang and Hao Wu and Xiaoliang Li and Feng Guo and Jiang Wu and Jesse Zhang and Venkatesh Raghavan},
  title = {{Greenplum: A Hybrid Database for Transactional and Analytical Workloads}},
  booktitle = {SIGMOD},
  year = {2021},
  doi = {10.1145/3448016.3457562},
}
Figure