TiDB (/‘taɪdiːbi:/, “Ti” stands for Titanium) is an open-source distributed SQL database built by PingCAP. It handles both transactional and analytical workloads on the same cluster, is fully compatible with MySQL 8.0 protocols, and runs on-premises, in public clouds, or natively on Kubernetes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pingcap/tidb/llms.txt
Use this file to discover all available pages before exploring further.
Key features
Distributed transactions
TiDB uses a two-phase commit protocol to provide ACID-compliant transactions that span multiple nodes. Transactions are committed only after writing to the majority of replicas, guaranteeing strong consistency even when nodes fail or network partitions occur.
HTAP
TiDB ships two storage engines: TiKV (row-based) for transactional workloads and TiFlash (columnar) for analytical queries. TiFlash replicates data from TiKV in real time using the Multi-Raft Learner protocol, so you can run OLAP queries on live data without ETL pipelines.
High availability
The Raft consensus protocol replicates every write to multiple replicas and automates failover. You can configure geographic placement of replicas to meet different disaster recovery requirements.
Horizontal and vertical scalability
TiDB separates computing from storage, so you can scale each layer independently. Add TiDB Server nodes to handle more queries, or add TiKV nodes to store more data — all without downtime.
MySQL compatibility
TiDB is compatible with MySQL 8.0. You can connect with any MySQL driver, ORM, or tool and migrate existing applications with no code changes or minimal modifications. TiDB also provides a suite of data migration tools.
Cloud-native and open source
TiDB runs in public clouds, on-premises, or on Kubernetes via TiDB Operator. All source code is available on GitHub under the Apache 2.0 license, including enterprise-grade features.
Who should use TiDB
High-scale OLTP
TiDB is designed for applications that outgrow a single MySQL instance. When you need to shard data across multiple databases, TiDB handles that automatically. You keep the MySQL interface, gain distributed transactions, and avoid the operational complexity of manual sharding.Mixed OLAP and OLTP (HTAP)
If you run analytical queries against your operational database — reporting, dashboards, aggregations — TiDB lets you do this without a separate data warehouse or ETL pipeline. TiFlash columnar storage is updated in real time from TiKV, so your analytics run on fresh data.MySQL migration
TiDB is wire-compatible with MySQL 8.0. Applications that connect to MySQL connect to TiDB without modification. PingCAP provides migration tooling to move data from existing MySQL instances into TiDB.TiDB listens on port 4000 for MySQL connections and port 10080 for HTTP status and metrics. This differs from MySQL’s default port of 3306.
Next steps
Quick start
Deploy a local TiDB cluster and run your first queries in minutes.
Architecture
Learn how TiDB Server, TiKV, TiFlash, and PD work together.