A high performing shard-enabled distributed database highly compatible with MySQL


TDSQL for MySQL is a comprehensive distributed database solution presented by Tencent. It features strong consistency, high availability and performance, global deployment architecture, distributed horizontal scaling, and enterprise-grade security. It also comes with services such as intelligent DBA, automated operations, and monitoring and alarming. At present, it proudly offers database services in both public and private clouds to over 500 governmental and organizational customers in various fields such as banking, insurance, securities, internet finance, billing, third-party payment, IoT, Internet+, and government affairs. Thanks to its quality products and services, TDSQL has earned multiple international and national accreditations and recognition from customers and industries.


Automated Sharding

You can automatically split a large table horizontally (i.e. sharding) in the database by setting the shardkey when the table is created. The TDSQL system will automatically distribute the written data evenly to different physical shards based on the hash scheme, and queries will also be automatically aggregated to return results. The sharding process is imperceptible to users, they simply see the complete table and do not need to concern themselves with the backend workings.

High Compatibility with MySQL Syntax

TDSQL is compatible with frequently used MySQL syntax elements, including MySQL's language structures, character sets, time zones, data types, common functions, preprocessing protocols, sorts, joins (JOIN), indices, partitions, transactions, control commands as well as common DDL, DML, and DCL commands and database access APIs.

Leading Distributed Architecture

Due to the particularity of the distributed architecture, it is virtually impossible to balance both advanced functionality and high performance for databases. To address this issue, TDSQL provides three table creation solutions, featuring (distributed) transaction characteristics, globally unique numerical sequences, and JSON format support, effectively filling the distributed architecture gaps and enabling more flexible development solutions.

Elastic Scalability Without Downtime

At present, one single shard can sustain up to 6 TB of storage. If the performance or capacity is insufficient, you can easily scale up with just a few clicks in the console. You do not need to worry about data migration, balancing, and route switching within the distributed system during the migration process, the IP stays unchanged, and the service will be interrupted for just a few seconds upon automatic switch. You only need to make sure that your business has a reconnection mechanism.

Strong Synchronous Replication

TDSQL adopts a master-slave architecture by default, which ensures over 99.95% availability. It supports strong synchronous replication for strong data consistency where an application transaction is responded to only after the data written by the business system is synced to the slave, ensuring complete master-slave data consistency and eliminating the possibility of data loss or corruption. At present, the performance of strong synchronous replication is basically equal to that of asynchronous replication.

Ultra-high Performance

Based on deeply customized and optimized MySQL kernel, TDSQL greatly outperforms MySQL. It supports read-write separation in three schemes, effectively ensuring development flexibility while providing read extensibility. It boasts optimized thread pool scheduling algorithms with better heavy load performance. In addition, it is equipped with PCI-E SSDs that feature an IO throughput three times of SATA disks, making it easier to meet the performance needs of your business.

Convenient Managed Deployment

A production-ready TDSQL instance can be started and connected to in minutes with just a few clicks in the TDSQL console. The console comes with frequently used database OPS operations that facilitate refined management of your database. Moreover, it is capable of displaying common system monitoring data and performance analysis data to help you quickly identify and troubleshoot database issues.

JSON Support

TDSQL supports native JSON types. Specifically, it doesn't store JSON values as strings; instead, it uses an internal binary format that allows for quick reading of document elements, which will automatically validate JSON texts when they are inserted or updated in JSON columns. In other words, you can think of TDSQL as a NoSQL database compatible with the MySQL protocol.

RocksDB Support

RocksDB is a storage engine based on LSM tree. Its data compression rate is over 60% higher than that of the InnoDB engine. Generally, it only needs about 1 GB storage space for 10 million rows of data after compression, which greatly reduces the database usage costs. Plus, it features high write performance, making it suitable for space-sensitive business scenarios where there are more writes than reads, such as IoT and logging. RocksDB support is currently in beta. 


TDSQL is a managed database service based on distributed architecture. It is highly compatible with MySQL and features high performance, availability, scalability, and ease of use as well as enterprise-grade security and monitoring.
High Compatibility with TDSQL

  • Compatible with frequently used MySQL syntax elements
  • These include MySQL's language structures, character sets, time zones, data types, common functions, preprocessing protocols, sorts, joins (JOIN), stored procedures, indices, partitions, transactions, control commands as well as common DDL, DML, and DCL commands and database access APIs.

  • (Distributed) Transaction Support
  • TDSQL supports distributed transactions through two-phase commit, making it ideal for scenarios such as money transfer, billing, and payment. Its cross-node transaction performance is about 70% of a single node, which is roughly 56% higher than that of XA, an open-source distributed transaction protocol. Currently, this capability is exclusive to MySQL 5.7.

  • (Distributed) JOIN Support
  • TDSQL supports JOIN (joint query) operations across physical nodes, namely, distributed joins. If a join-related table has a shardkey equality condition, thanks to the consistency principle of sharding, this part of data will be automatically stored to the same physical node. In this case, it is equivalent to performing a standalone join which has the best performance. If cross-physical node data is involved, the proxy will first pull data from other nodes and cache it, in which case performance will be compromised due to network data transfer.

  • JSON Support
  • TDSQL supports storing JSON formatted data, making JSON processing more efficient and enabling early detection of errors. If you want to use JSON types and do not want to compromise on traditional databases capabilities such as data consistency, transactions, and joins, TDSQL will be a good choice. The JSON support of TDSQL is based on MySQL, which slightly differs from MongoDB in terms of usage. If interested, you can check out the JSON capability comparison between TDSQL and MongoDB.

  • Three Table Creation Solutions
  • Sharded table: a horizontally split table. This solution is usually applicable to large and rapidly growing tables storing more than 20 million rows of data (over 50 GB);
  • Broadcast table: all operations are broadcast to all logical shards, which means that each shard has the full data of the table. This solution is usually suitable for configuration tables or tables that require frequent joins with fewer data updates. A broadcast table can converge joint queries (joins) and transactions between two tables to a single node for improved performance;
  • Single table: a table that does not need to be sharded. This solution is usually ideal for database tables with a small amount of data. As a single table is not split, it is fully compatible with MySQL during use.

  • Globally Unique Numerical Sequence
  • This is similar to AUTO_INCREMENT. The auto-increment sequence provides a globally unique numerical ID service to ensure the global uniqueness of data entries such as unique keys and primary keys in a distributed environment.

  • Command Passthrough
  • SQL statements can be passed through to a specified target shard through annotation (hint) to improve performance and operating flexibility.

  • Secondary Partition
  • TDSQL also supports table partitioning on top of sharding, i.e., adding an additional layer of logical partition (aka secondary partition) to the horizontally sharded table. This feature can balance data distribution and access while improving query efficiency, and are ideal for business scenarios where historical data needs to be deleted regularly, such as game match scores and IoT sensor data.



Suitable Business Types


Cloudification Recommendation

Performance is the most critical consideration for large e-commerce platforms, almost all of which are based on distributed databases. Only databases with a distributed architecture can overcome hardware restrictions and support linear scaling of performance to support high-traffic promotion events. In 2017, Tencent E-commerce Service Platform, launched less than a year ago, started to see high month-over-month growth. When the average orders per day surpassed the 10,000 mark, the performance and scalability disadvantages of non-distributed databases began to the surface. Their database service was successfully migrated to TDSQL within a month and stood the test of major sales events such as the 11/11 and 12/12 shopping sprees.


Suitable Business Types

Financial Services

Cloudification Recommendation

The rise of internet-based financial services such as mobile banking and online wealth management as well as advancements in blockchain technology have brought about dramatic changes in financial transactions; for example, more transactions in smaller amounts are made. Therefore, traditional database architectures can no long sustain business development, while network security risks start to increase. TDSQL, the first in China to apply distributed transactions to financial systems, boasts not only high performance scalability but also strong synchronous replication capabilities, helping prevent potential data errors and loss.


Suitable Business Types

IoT Businesses

Cloudification Recommendation

Typical IoT scenarios such as industrial monitoring and remote control, smart city, smart home, and IoV requires a large number of sensing and monitoring devices, high sample rate, and massive storage capacity. TDSQL offers an ideal solution in this regard. It not only has linearly scalable capacity, but also supports the MySQL protocol and JSON, enabling developers to develop systems in their preferred programming languages. TDSQL can be used together with RocksDB to lower the compression ratio to less than 20%. Moreover, its two-level partitioning feature can separate cold and hot data quickly and efficiently, which greatly lowers data storage costs and improves the efficiency of cold data processing.


Suitable Business Types

Gaming Businesses

Cloudification Recommendation

For SNS games with unified servers and emerging IO games, the number of peak concurrent users (PCUs) can reach 100,000 or even 10 million in a short period of time. Therefore, it is necessary to have the smooth scalability of all functional modules in mind at the very beginning of game development. Stateless servers such as GameSvr and MatchSvr are easy to scale. Scaling DBSvr, which records all relationship chains, match scores, and transactions, is a great challenge. TDSQL can help you address this problem with ease by scaling your game conveniently.


TencentDB for TDSQL provides two billing options: monthly subscription and pay-as-you-go. Monthly subscription users opt to prepay for a fixed period of usage ranging from one to multiple months or years depending on their business needs. Pay-as-you-go users pay for what they use. No upfront payment is required, making this option suitable for business with fluctuating demands.

For more information, see Product Pricing.