Inside Tencent’s TXSQL: Architecture, Evolution, and Enterprise‑Grade Features
This article reviews Tencent Cloud’s self‑developed MySQL kernel TXSQL, detailing its enterprise‑grade features, evolutionary roadmap, overall and cloud‑native TDSQL‑C architecture, columnar engine for OLAP, instant DDL capabilities, high‑availability mechanisms, performance optimizations, and the rigorous development and release process that underpins its stability.
Tencent’s Self‑Developed MySQL Kernel TXSQL
TXSQL is the Tencent Cloud database team’s self‑developed MySQL kernel branch, 100% compatible with native MySQL. It adds enterprise‑grade capabilities such as transparent data encryption, audit, thread pool, hot‑update protection, SQL throttling, and rapid column addition, significantly improving performance, stability, and meeting diverse business requirements.
TXSQL Evolution & Overall Architecture
Early TXSQL was based on MySQL 5.1 with simple bug fixes.
Versions 5.5‑5.6 added cloud platform adaptations and DBA tools.
TXSQL 5.7 became the most widely used version, introducing audit, compression, thread pool, and forming the basis for the cloud‑native TDSQL‑C kernel.
TXSQL 8.0 adds a columnar storage engine, AEP hardware acceleration, and many other optimizations.
Overall Architecture Diagram
The client connects through a thread pool to the server layer, which then accesses the storage engine layer. Supported engines include InnoDB, the self‑developed CStore columnar engine, RocksDB, and MyISAM. High‑performance SSDs provide local storage, while audit, transparent data compression, and semi‑sync replication plugins ensure security and reliability.
TDSQL‑C Cloud‑Native Architecture
TDSQL‑C is a next‑generation, high‑performance, highly available cloud‑native distributed database. It is 100% MySQL compatible, supports over one million QPS, and offers 128 TB of distributed intelligent storage. Its core design separates compute from storage, providing rapid elastic scaling.
Columnar Engine for OLAP
To serve OLAP workloads, Tencent developed a columnar storage engine with the following characteristics:
Columnar storage: Data stored by column reduces I/O by skipping irrelevant columns.
High compression ratio: Average 10:1 compression saves storage space.
Fast loading: Supports MySQL LOAD statements; parallel processing achieves up to 10× InnoDB load speed.
Execution engine: Handles arbitrary column combinations, supports billions of rows with sub‑second queries, and includes HASH JOIN.
Query optimization: Sparse indexes and pre‑computed aggregates improve performance.
MySQL compatibility: Full MySQL 8.0 syntax support, compatible with tools like phpMyAdmin and XtraBackup.
Instant DDL – “Second‑Level” Column Modification
TXSQL extends MySQL’s Instant DDL to support instant column modification, achieving true second‑level schema changes. Implementation includes:
Metadata multi‑versioning: Table metadata stores multiple column versions.
Row records carry version info linked to the appropriate metadata version.
Column changes modify only metadata, leaving actual row data untouched.
During reads, older rows are automatically transformed to the latest version.
During updates, old rows are refreshed to the newest version.
Enterprise‑Grade Features for B‑Side Users
High‑availability physical replication: Redo‑log based sync ensures fast, consistent master‑slave data pages.
Second‑level RTO: Buffer pool initialization, crash recovery, and rollback segment parallelization achieve sub‑second recovery.
Elastic scaling B‑tree consistency read optimization: Reads are not blocked by SMO operations during updates.
Performance optimizations for non‑volatile storage: Write acceleration, core binding, and hot/cold log separation boost throughput by up to 2221% in sync scenarios.
Hotspot updates: Kernel‑level solution enables instant updates for flash‑sale workloads without application changes.
Development & Release Process
The TXSQL development lifecycle includes requirement assessment, design proposal, design review, coding, specialized and generic testing, cloud‑environment simulation, gray‑release trials, and post‑release monitoring. This rigorous process ensures stability, rapid issue resolution, and continuous delivery of enterprise features and performance improvements.
Tencent Architect
We share technical insights on storage, computing, and access, and explore industry-leading product technologies together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.