Favicon of tidb

tidb

Open-source, distributed SQL database compatible with MySQL 8.0, combining transactional and analytical processing on the same data.

TiDB is an open-source, distributed SQL database built for applications that have outgrown what a single MySQL instance can handle. It separates compute from storage, replicates data with a Raft consensus protocol, and speaks the MySQL wire protocol, so existing drivers, ORMs, and tooling connect without code changes. It's aimed at teams running high-throughput transactional workloads that also need real-time analytics on the same data, without building a separate pipeline into a data warehouse.

Key features

  • Distributed transactions: TiDB uses a two-phase commit protocol across nodes to provide ACID guarantees. Transactions span multiple nodes, and the system keeps data correct even during network partitions or node failures.
  • Horizontal and vertical scalability: Add more nodes or resize existing ones without downtime. Compute and storage scale independently because the architecture keeps them separate.
  • High availability: A built-in Raft consensus protocol replicates data across multiple nodes and only commits a transaction once a majority of replicas confirm the write. Replica placement can be configured geographically for different disaster tolerance levels.
  • HTAP support: TiKV provides row-based transactional storage while TiFlash provides a columnar engine, kept in sync with TiKV in real time through a Multi-Raft Learner protocol. TiDB coordinates query execution across both, so transactional and analytical queries run against the same data without ETL.
  • Cloud-native deployment: Runs on public clouds, on-premises, or in Kubernetes via TiDB Operator, which automates cluster operations such as scaling and failover. TiDB Cloud offers a fully managed alternative.
  • MySQL compatibility: Compatible with MySQL 8.0, so applications can migrate with little or no code changes, and a set of data migration tools ships alongside the database.
  • Open source with enterprise features included: All source code, including enterprise-grade capabilities, is released under Apache 2.0.

Ideal use cases

TiDB fits teams that have hit the ceiling of a single MySQL server: high write throughput, datasets too large to shard by hand, or workloads that mix transactional writes with analytical reporting. Because it speaks MySQL, it's a reasonable migration target for an existing MySQL-backed application that needs to scale out rather than be rewritten against a different database engine. The built-in HTAP support is useful for real-time dashboards or reporting that would otherwise require replicating data into a separate analytical database.

It's not the right choice for small applications with modest data volumes or simple scaling needs. The operational surface, including compute nodes, storage nodes, a placement driver, and optionally TiFlash, is heavier than running a single MySQL or PostgreSQL instance, and getting the most out of it benefits from Kubernetes or a managed service such as TiDB Cloud. If your data fits comfortably on one server and you don't need HTAP, a simpler single-node database will mean less to operate.

Installation

TiDB can run as a local test cluster, deploy to Kubernetes, or run as a managed cloud service:

For a local playground, follow the quick start guide in the documentation, which sets up a test cluster for experimentation on a single machine.

For Kubernetes, TiDB Operator manages a self-hosted cluster, whether on your own infrastructure or on a Kubernetes service from a public cloud provider.

# Managed option: sign up for a free TiDB Cloud cluster
# https://tidbcloud.com/free-trial

For a managed option with a free tier and no infrastructure to run yourself, sign up for TiDB Cloud.

Once a cluster is running, connect with any MySQL driver or ORM. From there, the documentation covers TiDB's SQL dialect, data migration tools, changefeeds, vector search, HTAP queries, and disaster recovery setup.

To build from source or contribute code, see the TiDB Development Guide and the project's contributor guide, which list good first issues and other ways to get involved. The codebase is written in Go, and issues and discussions are tracked on GitHub.

Categories:

Frequently asked questions

Share:

Stars
40.3K
Forks
6.2K
Last commit
3 hours ago
Repository age
11 years
License
Apache-2.0
Self-hosted
No
Activity score
86/100
View Repository
Built with:

Similar to tidb

Favicon

 

  
  
Favicon

 

  
  
Favicon