
SIGMOD’23, June 18–23, 2023, Seale, WA, USA Jianying Wang et al.
OLTP DBMS
(e.g., MySQL)
OLAP DBMS
(e.g., ClickHouse)
ETL
REDO
HTAP DBMS
(PolarDB-IMCI)
QT
T Q
Figure 1: Comparison of ETL and PolarDB-IMCI.
to understand the working logic of the database, nor should they
identify query types manually. That is, users should not perceive
two isolated systems (e.g., engines, indexes, interfaces, etc.) for
OLAP and OLTP queries respectively. Our system should provide
a unied SQL interface for both OLAP and OLTP workloads.
• G#2: Advanced OLAP Performance.
As a major goal of any
HTAP database, the OLAP performance (e.g., execution latency)
of PolarDB-IMCI should be comparable to typical databases spe-
cialized in processing OLAP queries (typically through the intro-
duction of columnar data storage).
• G#3: Minimal Perturbation on OLTP Workloads.
While the
performance of OLAP queries is signicantly improved, it should
have a minimal negative impact on the performance of OLTP
queries. In fact, as we have practically validated in real application
scenarios, OLTP queries are usually more mission-critical and
are more sensitive to performance degradation. This requires
eective resource isolation for OLTP and OLAP queries.
• G#4: High Data Freshness.
High data freshness is an important
property of HTAP databases, which is a distinguishing advan-
tage compared to the traditional Extract-Transform-Load (ETL)
method. In this paper, we follow earlier similar work [
12
,
27
]
using the visibility delay as a freshness score for a query. By
denition, the visibility delay is the time interval during which
updates to the database can be visible to OLAP queries.
• G#5: Excellent Resource Elasticity.
In HTAP scenarios, the
consumption of CPU/IO resources uctuates signicantly, from
hundreds to thousands of times. As a key feature of cloud-native
databases, our system should ensure high resource elasticity
(e.g., scale-out in minutes or even seconds) to adaptively serve
the changing data volume and analytical workloads with stable
performance and high resource utilization.
PolarDB-IMCI meets all desired goals (i.e., G#1-5) with the fol-
lowing innovations. First, to meet G#1 and G#2, we implemented
in-memory column index (IMCI, §4) as complementary storage.
PolarDB-IMCI absorbs diverse advanced optimizations from the
OLAP community and derives a new SQL engine (§6.3) to match
the execution mode on columns. Further, PolarDB-IMCI proposes
a new query routing mechanism (§6.1) that dispatches queries trans-
parently.
Second, to meet G#3, PolarDB-IMCI resides column indexes on
separated read-only (RO) nodes (§3.1) with a shared storage archi-
tecture to provide eective resource isolation between OLTP and
OLAP requests. Updates are propagated to RO nodes by reusing
REDO logs (§5.3) (i.e., the dierential logging for the row store)
instead of shipping additional logical logs (i.e., MySQL Binlogs).
Third, to meet G#4, we enhance our update propagation frame-
work with commit-ahead log shipping (CALS, §5.1) and 2-Phase
conict-free log replay (2P-COFFER, §5.2). CALS ships transaction
logs before committing. 2P-COFFER eciently parses and applies
REDO logs to RO nodes. Furthermore, we implemented the column
index as append-only storage (§4): records are organized in insert or-
der rather than primary key order. Thus, updates to column indexes
are performed out-place and quickly.
Finally, to meet G#5, the checkpoint mechanism of the colum-
nar index is seamlessly built into PolarDB’s original storage en-
gine. Therefore fast scale-out capability can be achieved by quickly
pulling up a RO node using the checkpoint on shared storage (§7).
We started the design and development of cloud-native PolarDB
in 2017, and seek for an HTAP solution (i.e., PolarDB-IMCI) in 2019.
By now, PolarDB-IMCI is severing a large number of internal and
external customers (Table 3). The key contributions of this work
are listed as follows:
•
We propose PolarDB-IMCI, an HTAP solution for cloud-
native relational database systems. To the best of our knowl-
edge, PolarDB-IMCI is the rst cloud-native HTAP database
to satisfy all of the aforementioned design goals.
•
We design an architecture that provides dual-format stor-
age on read-only nodes under the storage-computation sep-
aration architecture, which enables ecient execution of
analytical queries and minimizes the impact on OLTP load.
Additionally, PolarDB-IMCI is the rst practical template
to demonstrate that it is possible and applicable to imple-
ment replication from row-store to dual-format storage with
physical redo logs while reducing replication latency to mil-
lisecond levels.
•
We evaluate PolarDB-IMCI with diverse experiments (in
both experimental and production environments). The ex-
perimental results show that PolarDB-IMCI outperforms
row-based PolarDB up to
×
149 on a standard analytical
workload TPC-H (100
𝐺𝐵
), and its performance is compa-
rable to the advanced OLAP databases (e.g., ClickHouse).
Performance degradation on OLTP is tiny (less than 5%),
even when OLAP workloads increase continuously. The visi-
bility delay of PolarDB-IMCI at is <5
𝑚𝑠
on typical workloads,
and <30
𝑚𝑠
under heavy workloads. PolarDB-IMCI can scale
out in tens of seconds.
The remainder of the paper is organized as follows. §2 introduces
the background of HTAP and cloud-native databases. §3 presents
the architecture. PolarDB-IMCI’s components and update prop-
agation framework are introduced in §4 and §5 respectively. §6
discusses query dispatch, optimization, and execution. §7 intro-
duces the checkpoint mechanism. §8 details the experiments and
evaluation. §9 concludes the paper.
2 BACKGROUND AND RELATED WORK
2.1 Hybrid Transactional/Analytical
Processing
For long decades, OLTP and OLAP databases are dedicatedly de-
signed for their respective workloads. For instance, OLTP engines
(e.g., MySQL [
40
]) prefer row-based data formats, row-at-a-time
operators, and early materialization strategy, favoring data mod-
ication and point queries. On the contrary, OLAP engines (e.g.,
评论