TDSQL is an abbreviation for TecentDistributed SQL. It is derived from MySQL and aimed at providing digital payment services for government and financial companies. TDSQL supports a strong consistency model based on Raft. Data are partitioned horizontally based on the partition key and auto sharding is enabled to facilitate data migration. TDSQL can be deployed on both private cloud and public cloud.
Relational Key/Value Document / XML
TDSQL supports multiple data models to meet different application requirements. MySQL API, Redis API, and MongoDB API are used to communicate with SQL execution engine, KV execution engine, and Doc execution engine respectively. There is a data conversion layer between the execution layer and the storage layer to unify the data format.
The TDSQL framework can be divided into the following layers. The computer layer, which consists of the compute engine, is stateless. For the storage layer, data are stored in the unit of the replica set with multiple duplicates. Strong consistency is guaranteed by the Raft consistency model.
It only supports joining on the same node, which requires join tables to be partitioned on the same key or the table is small enough to be copied across all partitions. Then the proxy/coordinator merges the results from different shards to generate the final result. Join is not supported if the join operation touches data across nodes and the join key is different from the partition key.
Two-Phase Locking (Deadlock Detection)
Global wait-for-graphs are created to detect deadlocks. The timer is applied to count how long a transaction has been started. If a transaction is not finished within a given time period, the timer will indicate a potential deadlock.
N-ary Storage Model (Row/Record)
Since TDSQL is derived from InnoDB, each node uses the same storage model as InnoDB, which is a row-storage DBMS.
The 3-level storage strategy is used to save storage resources and reduce query latency. According to the 3-level storage strategy, all data can be classified into Standard Storage (hot data), Infrequent Access Storage (warm data), and Archive (cold data). Automatic conversion is triggered between different storage levels under different lifecycles. Standard Storage is stored in three copies on SSD and Infrequent access Storage is stored in 2 copies on SATA. Archive is stored in 1.3 copies on SATA.
https://cloud.tencent.com/document/product/557
Tecent
2012