Back to directory

Infrastructure & Operations · Databases

TiDB

MySQL-compatible distributed SQL for scale, transactions and analytics

TiDB is an Apache-2.0 distributed SQL database for teams that need MySQL compatibility, ACID transactions, horizontal scaling and HTAP analytics. PingCAP maintains the project with community contributors. TiDB Cloud provides a hosted service, including a free Starter allowance and paid compute and dedicated tiers.

Key facts

License
Apache-2.0
Main language
Go, Rust
Maintainer
PingCAP and community
First released
2015
Latest release
v8.5.8, August 27, 2026
GitHub stars
40.7k, October 2026
Hosted option
TiDB Cloud free Starter allowance; paid plans from $400/month

What TiDB is

TiDB is a MySQL-compatible distributed SQL database maintained by PingCAP and community contributors. PingCAP was founded in 2015 by Max Liu, Edward Huang and Qiu Cui, and the repository was created that year. GitHub showed 40,669 stars during this review, while PingCAP reported more than 1,500 adopting companies in its 2020 funding announcement, including Square, Shopee, Dailymotion, BookMyShow, Bank of China and JD.com. PingCAP reported a $50 million Series C in 2018 and a $270 million Series D in 2020. The Apache-2.0 project targets applications that need transactional consistency and scale beyond a conventional single-node MySQL deployment. Its current repository describes support for transactions, analytics and vector search.

How it works

A typical TiDB deployment presents a MySQL-compatible SQL endpoint to applications, so existing drivers and many tools can connect with limited application changes. TiDB servers handle SQL parsing, planning and execution, while TiKV stores transactional row data and Placement Driver manages cluster metadata and scheduling. Raft replication provides consensus, and distributed transactions use two-phase commit for ACID behavior. Teams can add TiDB compute nodes separately from TiKV storage nodes, then use TiFlash when analytical queries need a columnar representation. The workflow is familiar to MySQL users: create schemas, connect through the standard protocol, run transactions, monitor the cluster, and scale components as workload changes. PingCAP also documents migration tools and TiCDC for change data capture.

Architecture and recent releases

TiDB is primarily written in Go, with Rust components in the broader TiDB stack. Its deployment model separates SQL compute from storage and control-plane services: TiDB, TiKV and Placement Driver form the core cluster, while TiFlash adds columnar replicas for HTAP queries. TiDB Operator manages clusters on Kubernetes, and TiUP supports production deployment outside Kubernetes. Integrations documented by PingCAP include MySQL-compatible clients, migration tools, TiCDC and cloud deployment. The v8.5 release line reached v8.5.8 on August 27, 2026, and the v7.5 line reached v7.5.8 on September 17, 2026. Recent v8.5.8 notes include optimizer changes, TiCDC performance work and dependency updates addressing known security vulnerabilities.

License and pricing

The core database is licensed under Apache-2.0, which permits commercial use, modification and redistribution under the license conditions. The project repository states that enterprise-grade features are available under Apache-2.0. TiDB Cloud is PingCAP's managed offering. Its published free Starter allowance includes 25 GiB of row storage, 25 GiB of columnar storage and 250 million request units per organization each month. Published paid prices start at $400 per month for Essential compute, $1,800 per month for Premium compute, or $1,376 per month for a Dedicated cluster. Those prices describe TiDB Cloud plans, while self-hosting requires operators to provide compute, storage, networking, monitoring and backup infrastructure.

Limitations and how it compares

TiDB's distributed architecture brings more components and operational decisions than a single MySQL or PostgreSQL server. TiKV, Placement Driver, TiDB Server and optional TiFlash each affect sizing, failure handling and upgrades, and Kubernetes deployments add Operator administration. MySQL compatibility reduces migration work, but it does not guarantee identical behavior for every feature or workload. CockroachDB is a closer proprietary and open-source distributed SQL comparison, PostgreSQL offers a mature single-system alternative, and YugabyteDB provides another distributed SQL design with PostgreSQL compatibility. Choose TiDB when MySQL compatibility, independent compute and storage scaling, and combined transactional and analytical workloads matter more than minimizing cluster complexity.

Main features

  • MySQL compatibility. Applications can connect through the MySQL protocol and reuse familiar drivers, frameworks and many existing migration patterns.
  • Distributed transactions. Two-phase commit supports ACID transactions across nodes, while Raft replication provides consensus and majority-based commit behavior.
  • Independent scaling. TiDB separates SQL compute from TiKV storage, allowing teams to add resources to each layer independently.
  • HTAP queries. TiFlash maintains columnar replicas from TiKV, letting transactional and analytical workloads use separate physical representations.
  • Kubernetes operations. TiDB Operator creates and manages TiDB clusters on Kubernetes, including routine cluster operations and component orchestration.
  • Change data capture. TiCDC streams database changes to supported sinks for replication, migration, integration and downstream processing workflows.
  • Vector search. The current project description lists native vector search alongside transactional and analytical database capabilities.

Self-hosting TiDB

TiDB can run locally through the documented quick start, in production with TiUP, or on Kubernetes with TiDB Operator. A cluster requires TiDB SQL servers, TiKV storage nodes and Placement Driver, with TiFlash added for columnar analytics. The documentation describes deployment on self-managed or public-cloud Kubernetes. No single minimum production hardware profile is stated here because sizing depends on workload and topology. Operators must plan persistent storage, network connectivity, monitoring, rolling upgrades and backups for every stateful component. TiDB's release documentation provides version-specific deployment and upgrade guidance, while TiDB Operator handles Kubernetes cluster operations.

Strengths

  • Apache-2.0 licensing permits commercial deployment without a proprietary core split.
  • MySQL protocol compatibility can reduce application changes during migration.
  • Compute and storage scale independently across dedicated cluster components.
  • TiFlash supports transactional and analytical workloads within one database system.

Drawbacks

  • A production cluster has more components to operate than a single MySQL or PostgreSQL server.
  • TiFlash and distributed transaction behavior add sizing and troubleshooting work.
  • MySQL compatibility does not guarantee identical behavior for every MySQL feature.

What teams replace with it

Teams usually evaluate TiDB when they want to move off Amazon Aurora, Google Cloud Spanner, Oracle Database.

For side-by-side commercial comparisons, browse our alternatives hub.

Open-source alternatives to TiDB

  • CockroachDB
  • YugabyteDB
  • PostgreSQL
  • MariaDB
  • MySQL

Frequently asked questions

Is TiDB free to use?

The TiDB database is available under Apache-2.0 and can be self-hosted without a published software license fee. Self-hosting still incurs infrastructure and operational costs. TiDB Cloud has a free Starter allowance of 25 GiB row storage, 25 GiB columnar storage and 250 million request units per organization monthly, with paid plans for larger deployments.

Can companies use TiDB commercially?

Yes. The core TiDB repository uses Apache-2.0, which permits commercial use, modification and redistribution subject to the license conditions. PingCAP states that the repository includes enterprise-grade features under Apache-2.0. Commercial users remain responsible for infrastructure, support choices, security controls and compliance requirements for their deployment.

How do I self-host TiDB, and what does it require?

Use TiUP for production deployment outside Kubernetes, or TiDB Operator for a Kubernetes cluster. The core topology includes TiDB SQL servers, TiKV storage nodes and Placement Driver. TiFlash is optional for columnar analytics. Operators need persistent storage, networking, monitoring and backups, with capacity chosen for workload and failure tolerance.

How does TiDB compare with CockroachDB?

Both provide distributed SQL, ACID transactions, replication and horizontal scaling. TiDB emphasizes MySQL compatibility and separates TiDB compute from TiKV storage, with TiFlash for HTAP analytics. CockroachDB uses PostgreSQL compatibility and a different distributed storage design. TiDB fits teams whose applications and tools are centered on MySQL behavior and interfaces.

Is TiDB secure for private data?

Self-hosted TiDB keeps database data within infrastructure chosen by the operator, subject to that environment's access controls, encryption, network design, backups and patching. TiDB Cloud is operated by PingCAP under its service controls. The v8.5.8 release notes mention dependency updates addressing known security vulnerabilities, so operators should follow version-specific security guidance and upgrade practices.

Similar projects to compare

Sources

Last updated 2026-10-22.