Databases 11 min read

Deep Dive into Tencent's Self‑Developed MySQL Kernel TXSQL and Its Architecture

This article provides a comprehensive overview of Tencent's self‑developed MySQL kernel TXSQL, covering its evolution, overall architecture, columnar storage engine, instant DDL capabilities, enterprise‑grade features, high‑availability mechanisms, performance optimizations, and the rigorous development and testing processes behind the product.

Tencent Database Technology
Tencent Database Technology
Tencent Database Technology
Deep Dive into Tencent's Self‑Developed MySQL Kernel TXSQL and Its Architecture

At the 14th China System Architect Conference (SACC2022), Tencent Cloud database engineer Lai Zheng presented "An Overview of Tencent Cloud Enterprise‑Level MySQL Database Product Architecture," focusing on the internally developed MySQL kernel branch TXSQL.

TXSQL is a 100% MySQL‑compatible, self‑developed kernel that adds enterprise features such as transparent data encryption, auditing, thread pools, hot‑update protection, SQL throttling, and rapid column addition, greatly improving performance and stability for both internal and external customers ranging from a few gigabytes to hundreds of terabytes.

The evolution of TXSQL includes:

Initial version based on MySQL 5.1 with simple bug fixes.

5.5–5.6 versions added cloud platform adaptations and DBA tools.

5.7 version became the most widely used, introducing audit, compression, thread pool, and the foundation for the cloud‑native TDSQL‑C kernel.

Latest 8.0 version adds an indexed column‑store engine, AEP hardware acceleration, and many other optimizations.

The overall TXSQL architecture consists of a client layer, thread pool, server layer, and a storage engine layer that supports InnoDB, a self‑developed CStore columnar engine, RocksDB, and MyISAM. Additional components include high‑performance SSD storage, an audit plugin, transparent data compression/encryption plugin, and semi‑synchronous replication.

TDSQL‑C, the cloud‑native database built on the same kernel, offers 100% MySQL compatibility, over one million QPS, and 128 TB distributed storage, with a design that separates storage and compute for elastic scaling.

The columnar engine targets OLAP workloads, providing features such as column‑wise storage, high compression ratios (≈10:1), fast bulk loading (up to 10× InnoDB), advanced execution engine supporting billions of rows per second, and full MySQL 8.0 syntax compatibility.

TXSQL also pioneered instant DDL column modification, extending MySQL's Instant DDL to achieve true “second‑level” column changes by employing metadata multi‑versioning, versioned row records, and on‑read/write conversion.

Additional enterprise‑grade capabilities include high‑availability physical replication, sub‑second RTO via fast buffer‑pool initialization and crash recovery, B‑tree consistent‑read optimization, NVMe‑focused write acceleration, and hotspot update handling for flash‑sale scenarios.

The development process follows a mature R&D workflow: demand assessment, design review, coding, specialized functional testing, generic testing, cloud‑environment simulation, gray‑release, and post‑release monitoring, ensuring stability for over 100,000 online instances.

Future priorities are maintaining stability, delivering enterprise‑level features for DBA challenges, and continuous performance optimization.

High AvailabilityMySQLcolumnar storageCloud DatabaseTXSQLDatabase Kernel
Tencent Database Technology
Written by

Tencent Database Technology

Tencent's Database R&D team supports internal services such as WeChat Pay, WeChat Red Packets, Tencent Advertising, and Tencent Music, and provides external support on Tencent Cloud for TencentDB products like CynosDB, CDB, and TDSQL. This public account aims to promote and share professional database knowledge, growing together with database enthusiasts.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.