TDSQL

TDSQL is an abbreviation for TecentDistributed SQL. It is derived from MySQL and aimed at providing digital payment services for government and financial companies. It can be deployed on both private cloud and public cloud.

History

TDSQL was initially used internally (2012) by the Tecent company. It was used as the DBMS for WeBank (WeBank is China’s first digital bank established in December 2014) in 2014. TDSQL is moved to the cloud and starts to provide services for companies other than Tecent in 2015.

Query Interface

HTTP / REST

  • Support SDK for python, java, php, nodejs, .net.
  • Tecent Cloud CLI can also be used to interact with the DBMS
  • HTTPS/REST API is also supported

Checkpoints

Blocking

Memory data need to be flushed to disk to make sure all data are saved. Read locks are need to lock on all tables before making the checkpoint.

Data Model

Relational

System Architecture

Shared-Nothing

The TDSQL framework can be divided into the following layers

  • Computer layer: The compute engine is stateless
  • Storage layer: Data are stored in the unit of the replica set with multiple duplicates. Strong consistency is guaranteed by the Raft consistency model.

Indexes

B+Tree

TDSQL uses the index supported by InnoDB. InnoDB uses B+ tree as the default index data structure.

Storage Architecture

Disk-oriented

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 trigger 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.

Joins

Not Supported

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.

Concurrency Control

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.

TDSQL Logo
Website

http://tdsql.org/

Country of Origin

CN

Start Year

2012

Project Type

Commercial

Derived From

MySQL

Inspired By

MySQL

Compatible With

RocksDB