Introduction
In modern data management, a persistent divide exists between Online Transactional Processing (OLTP) and Online Analytical Processing (OLAP). Traditionally, organizations bridge this gap using Extract, Transform, Load (ETL) processes to move data from transactional databases to dedicated data warehouses. However, this approach introduces significant architectural complexity, high operational costs, and data staleness that can range from minutes to days. Furthermore, attempting to run complex analytical queries directly on transactional engines often leads to resource contention, degrading the performance of mission-critical business operations.
PolarDB-IMCI addresses these challenges by providing a cloud-native Hybrid Transactional/Analytical Processing (HTAP) architecture. Built on Alibaba’s PolarFS storage-computation separation framework, PolarDB-IMCI enables users to execute complex analytics on live transactional data with near-zero performance trade-offs, maintaining data freshness within milliseconds while achieving massive speedups in query execution.
System Architecture and Innovations
PolarDB-IMCI is designed around the principle of "transparency" and "elasticity." It treats columnar storage not as a separate database, but as a specialized In-Memory Column Index (IMCI). This index is maintained on elastic Read-Only (RO) nodes, effectively isolating analytical workloads from the primary Read/Write (RW) node responsible for transactions.
Physical REDO Log Synchronization
Unlike many HTAP systems that rely on logical logs (such as MySQL Binlogs) for data synchronization—which can impose significant overhead on the primary node—PolarDB-IMCI reuses physical REDO logs. These are the same logs generated for crash recovery and durability. By repurposing these logs to update the columnar index, the system achieves synchronization with almost zero additional impact on transactional throughput.
High-Performance Replay: CALS and 2P-COFFER
To ensure extreme data freshness, the system utilizes two novel mechanisms:
- Commit-Ahead Log Shipping (CALS): This mechanism ships logs to RO nodes before the transaction finishes committing on the primary node, minimizing the visibility delay.
- 2P-COFFER: A two-phase parallel replay mechanism designed to process physical logs at scale. This allows RO nodes to maintain high-concurrency updates to the columnar index without becoming a bottleneck.
Transparent Query Routing
PolarDB-IMCI maintains 100% compatibility with the MySQL ecosystem. A cost-based optimizer automatically determines the most efficient execution path. If a query involves point lookups or small-scale updates, it is routed to the row-based engine. If it involves large-scale scans or complex aggregations, it is transparently directed to the columnar engine. This ensures that users can leverage analytical acceleration without modifying their existing SQL code.
Performance Evaluation
The system was evaluated using industry-standard benchmarks (TPC-H, CH-benCHmarks, and Sysbench) alongside real-world production workloads from Alibaba Cloud customers in finance, logistics, and gaming.
Key Findings
- Analytical Acceleration: On a 100GB TPC-H dataset, PolarDB-IMCI demonstrated up to a 149x speedup compared to the standard row-based PolarDB engine for scan-intensive queries. Its performance was found to be competitive with, or superior to, specialized OLAP databases like ClickHouse.
- Transactional Integrity: Running heavy analytical workloads resulted in less than 5% degradation in transactional throughput. This confirms the effectiveness of the physical isolation between RW and RO nodes.
- Data Freshness: The "visibility delay"—the time between a transaction commit and its availability for analysis—remained consistently under 5ms for typical workloads and stayed below 30ms even under extreme stress.
- Cloud Elasticity: Leveraging shared storage (PolarFS), the system can scale out new analytical nodes in tens of seconds, allowing it to respond dynamically to spikes in query demand.
Conclusion and Future Work
PolarDB-IMCI successfully bridges the transaction-analytics divide by integrating a columnar index into a cloud-native architecture. By utilizing physical log replay and storage-computation separation, it provides a high-performance, transparent, and cost-effective HTAP solution.
Future development focuses on refining the hybrid cost model to allow for more granular optimization and exploring "hybrid execution," where a single query plan can seamlessly mix row-based and column-based operators to maximize efficiency across diverse workloads.
Summary updated