HOME

TheInfoList



OR:

TiDB (/’taɪdiːbi:/, "Ti" stands for Titanium) is an open-source
NewSQL NewSQL is a class of relational database management systems that seek to provide the scalability of NoSQL systems for online transaction processing (OLTP) workloads while maintaining the ACID guarantees of a traditional database system. Man ...
database that supports Hybrid Transactional and Analytical Processing ( HTAP) workloads. It is
MySQL MySQL () is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A relational database o ...
compatible and can provide horizontal scalability, strong consistency, and high availability. It is developed and supported primarily b
PingCAP
Inc. and licensed under Apache 2.0. TiDB drew its initial design inspiration from Google's Spanner and F1 papers.


Release history

See al
TiDB release notes
* On April 7, 2022
TiDB 6.0 GA
was released. * On April 7, 202
TiDB 5.0 GA
was released. * On May 28, 2020
TiDB 4.0 GA
was released. Its key features include
TiFlashTiDB Dashboard
(experimental)
TiUPpessimistic transactions
cascading placement rules (experimental), elastic scheduling (experimental), large transactions
new SQL features
case-insensitive and accent-insensitive `utf8mb4_general_ci` and `utf8_general_ci` collations, improved encrypted communication, Transparent Data Encryption (TDE)
Backup & RestoreCoprocessor Cache
(experimental)
Follower Read
an
TiCDC
(experimental).     * On June 28, 2019
TiDB 3.0 GA
was released. * On April 27, 2018
TiDB 2.0 GA
was released. * On October 16, 2017
TiDB 1.0 GA
was released.


Main features


Horizontal scalability

TiDB can expand both SQL processing and storage capacity by adding new nodes. This makes infrastructure capacity scaling easier and more flexible compared to traditional
relational database A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relatio ...
s which only scale vertically.


MySQL compatibility

TiDB acts like it is a
MySQL MySQL () is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A relational database o ...
5.7 server to applications. A user can continue to use all of the existing MySQL client libraries. Because TiDB’s SQL processing layer is built from scratch, not a MySQL fork, its compatibility is not 100%, and there are known behavior differences between MySQL and TiDB.


Distributed transactions with strong consistency

TiDB internally shards a table into small range-based chunks that are referred to as "Regions". Each Region defaults to approximately 100 MB in size, and TiDB uses a
two-phase commit In transaction processing, databases, and computer networking, the two-phase commit protocol (2PC) is a type of atomic commitment protocol (ACP). It is a distributed algorithm that coordinates all the processes that participate in a distributed ...
internally to ensure that regions are maintained in a transactionally consistent way.


Cloud native

TiDB is designed to work in the cloud to make deployment, provisioning, operations, and maintenance flexible. The storage layer of TiDB, called TiKV, became a
Cloud Native Computing Foundation The Cloud Native Computing Foundation (CNCF) is a Linux Foundation project that was founded in 2015 to help advance container technology and align the tech industry around its evolution. It was announced alongside Kubernetes 1.0, an open sour ...
(CNCF) member project in August 2018, as a Sandbox level project, and became an incubation-level hosted project in May 2019. TiKV graduated from CNCF in September 2020. The architecture of the TiDB platform also allows SQL processing and storage to be scaled independently of each other.


Real-time HTAP

TiDB can support both online transaction processing (
OLTP In online transaction processing (OLTP), information systems typically facilitate and manage transaction-oriented applications. This is contrasted with online analytical processing. The term "transaction" can have two different meanings, both of w ...
) and online analytical processing (
OLAP Online analytical processing, or OLAP (), is an approach to answer multi-dimensional analytical (MDA) queries swiftly in computing. OLAP is part of the broader category of business intelligence, which also encompasses relational databases, repor ...
) workloads. TiDB has two storage engines: TiKV, a rowstore, and TiFlash, a columnstore. Data can be replicated from TiKV to TiFlash in real time to ensure that TiFlash processes the latest data.


High availability

TiDB uses the
Raft consensus algorithm Raft is a consensus algorithm designed as an alternative to the Paxos family of algorithms. It was meant to be more understandable than Paxos by means of separation of logic, but it is also formally proven safe and offers some additional featu ...
to ensure that data is highly available and safely replicated throughout storage in Raft groups. In the event of failure, a Raft group will automatically elect a new leader for the failed member, and self-heal the TiDB cluster without any required manual intervention. Failure and self-healing operations are transparent to the applications.


Deployment methods


Kubernetes with Operator

TiDB can be deployed in a
Kubernetes Kubernetes (, commonly stylized as K8s) is an open-source container orchestration system for automating software deployment, scaling, and management. Google originally designed Kubernetes, but the Cloud Native Computing Foundation now maintains ...
-enabled cloud environment by using TiDB Operator. An Operator is a method of packaging, deploying, and managing a Kubernetes application. It is designed for running stateful workloads and was first introduced by
CoreOS Container Linux (formerly CoreOS Linux) is a discontinued open-source lightweight operating system based on the Linux kernel and designed for providing infrastructure to clustered deployments, while focusing on automation, ease of application ...
in 2016. TiDB Operator was originally developed by PingCAP and open-sourced in August, 2018. TiDB Operator can be used to deploy TiDB on a laptop,
Google Cloud Platform Google Cloud Platform (GCP), offered by Google, is a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user products, such as Google Search, Gmail, Google Drive, and YouTube. Alongside ...
’s Google Kubernetes Engine, and
Amazon Web Services Amazon Web Services, Inc. (AWS) is a subsidiary of Amazon.com, Amazon that provides Software as a service, on-demand cloud computing computing platform, platforms and Application programming interface, APIs to individuals, companies, and gover ...
’ Elastic Container Service for Kubernetes.


TiUP

TiDB 4.0 introduce
TiUP
a cluster operation and maintenance tool. It helps users quickly install and configure a TiDB cluster with a few commands.


TiDB Ansible

TiDB can be deployed using
Ansible An ansible is a category of fictional devices or technology capable of near-instantaneous or faster-than-light communication. It can send and receive messages to and from a corresponding device over any distance or obstacle whatsoever with no d ...
by using a TiDB Ansible playbook (not recommended).


Docker

Docker can be used to deploy TiDB in a containerized environment on multiple nodes and multiple machines, and Docker Compose can be used to deploy TiDB with a single command for testing purposes.


Tools

TiDB has a series of open-source tools built around it to help with data replication and migration for existing
MySQL MySQL () is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A relational database o ...
and
MariaDB MariaDB is a community-developed, commercially supported fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. Development is led by some of the ori ...
users.


TiDB Data Migration (DM)

TiDB Data Migration (DM) is suited for replicating data from already sharded MySQL or MariaDB tables to TiDB. A common use case of DM is to connect MySQL or MariaDB tables to TiDB, treating TiDB almost as a slave, then directly run analytical workloads on this TiDB cluster in near real-time.


Backup & Restore

Backup & Restore (BR) is a distributed backup and restore tool for TiDB cluster data. It offers high backup and restore speeds for large-scale TiDB clusters.


Dumpling

Dumpling is a data export tool that exports data stored in TiDB or MySQL. It lets users make logical full backups or full dumps from TiDB or MySQL.


TiDB Lightning

TiDB Lightning is a tool that supports high speed full-import of a large MySQL dump into a new TiDB cluster, providing a faster import experience than executing each SQL statement. This tool is used to quickly populate an initially empty TiDB cluster with much data, in order to speed up testing or production migration. The import speed improvement is achieved by parsing SQL statements into key-value pairs, then directly generate Sorted String Table (SST) files to
RocksDB RocksDB is a high performance embedded database for Key-value database, key-value data. It is a fork of Google's LevelDB optimized to exploit many multi-core processor, CPU cores, and make efficient use of fast storage, such as solid-state drives ...
.


TiDB Binlog

TiDB Binlog is a tool used to collect the logical changes made to a TiDB cluster. It is used to provide incremental backup and replication, either between two TiDB clusters, or from a TiDB cluster to another downstream platform. It is similar in functionality to MySQL primary-secondary replication. The main difference is that since TiDB is a distributed database, the binlog generated by each TiDB instance needs to be merged and sorted according to the time of the transaction commit before being consumed downstream.


Editions

TiDB comes in three versions: Enterprise, cloud on premise and the open source version licensed under the Apache 2.0 license.


See also

*
YugabyteDB YugabyteDB is a high-performance transactional distributed SQL database for cloud-native applications, developed by Yugabyte. History Yugabyte was founded by ex-Facebook engineers Kannan Muthukkaruppan, Karthik Ranganathan, and Mikhail Baut ...
*
CockroachDB CockroachDB is a commercial distributed SQL database management system, developed by Cockroach Labs. History Cockroach Labs was founded in 2015 by ex-Google employees Spencer Kimball, Peter Mattis, and Ben Darnell. Cockroach Labs founders Kim ...


References

{{reflist Free and open-source software Databases NewSQL