TiDB logo

TiDB

Scalable, cloud-native SQL database with strong consistency.

TiDB delivers a distributed, MySQL-compatible SQL engine that scales horizontally and vertically, offers ACID transactions, HTAP capabilities, and seamless cloud or Kubernetes deployment.

TiDB banner

Overview

Overview

TiDB is a distributed SQL database that combines the familiarity of MySQL 8.0 with cloud‑native architecture. It provides strong consistency through a two‑phase commit protocol and Raft‑based replication, ensuring ACID‑compliant transactions across multiple nodes.

Capabilities & Deployment

The system separates compute from storage, allowing horizontal scaling by adding nodes and vertical scaling by increasing resources without downtime. TiDB supports HTAP workloads via TiKV (row‑store) and TiFlash (columnar store), enabling real‑time analytics alongside transactional processing. Deployments can run on public clouds, on‑premises, or within Kubernetes using the TiDB Operator, while TiDB Cloud offers a fully managed, click‑to‑launch option.

Audience

Ideal for enterprises and SaaS providers that need fault‑tolerant, scalable databases while retaining compatibility with existing MySQL tools and ecosystems.

Highlights

Distributed ACID transactions via two‑phase commit
Horizontal & vertical scaling without downtime
Built‑in high availability with Raft consensus
Hybrid Transactional/Analytical Processing (HTAP) with TiKV and TiFlash

Pros

  • Strong consistency across distributed nodes
  • MySQL 8.0 compatibility reduces migration effort
  • Flexible deployment on cloud, on‑prem, or Kubernetes
  • Apache 2.0 open‑source license encourages community contributions

Considerations

  • Operational complexity can increase with large clusters
  • Higher resource usage compared to single‑node databases
  • Performance tuning may require understanding of TiKV/TiFlash internals
  • Enterprise features may need TiDB Cloud or paid support

Managed products teams compare with

When teams consider TiDB, these hosted platforms usually appear on the same shortlist.

Amazon Aurora logo

Amazon Aurora

MySQL- and PostgreSQL-compatible cloud relational database service offering high performance and high availability

CockroachDB logo

CockroachDB

Distributed SQL database designed for horizontal scale and high resilience across regions

PlanetScale logo

PlanetScale

Serverless MySQL platform with Git-like branching

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • Enterprises needing scalable, fault‑tolerant OLTP workloads
  • Applications requiring real‑time analytics alongside transactions
  • Teams leveraging existing MySQL tools and drivers
  • Organizations adopting cloud‑native or Kubernetes infrastructures

Not ideal when

  • Small projects with minimal data volume and simple queries
  • Environments lacking expertise in distributed system operations
  • Use cases demanding ultra‑low latency single‑node performance
  • Teams preferring proprietary, vendor‑locked database solutions

How teams use it

E‑commerce platform handling flash sales

Maintains ACID transactions across thousands of nodes while providing real‑time inventory analytics.

FinTech application with mixed OLTP/OLAP workloads

Delivers consistent transaction processing and instant analytical reporting without separate systems.

SaaS product scaling across regions

Deploys TiDB clusters in multiple clouds, ensuring high availability and low latency for global users.

Data migration from legacy MySQL

Uses TiDB’s MySQL compatibility and migration tools to lift‑and‑shift with minimal code changes.

Tech snapshot

Go94%
Starlark3%
Shell2%
Yacc1%
Jsonnet1%
TypeScript1%

Tags

distributed-databasedistributed-transactionsgomysql-compatibilityhacktoberfesthtapcloud-nativesqlscaledatabaseserverlesstidbmysql

Frequently asked questions

Is TiDB compatible with existing MySQL clients?

Yes, TiDB implements the MySQL 8.0 protocol, so standard MySQL drivers, ORMs, and tools work out of the box.

How does TiDB achieve high availability?

TiDB uses the Raft consensus algorithm; data is replicated across multiple nodes, and automatic failover occurs when a replica becomes unavailable.

Can I run TiDB on Kubernetes?

Absolutely. The TiDB Operator automates cluster provisioning, scaling, and upgrades within Kubernetes environments.

What is HTAP and how does TiDB support it?

HTAP combines transactional (TiKV) and analytical (TiFlash) processing; TiFlash replicates data in real time, enabling fast columnar queries alongside row‑based transactions.

Is TiDB free to use?

TiDB is released under the Apache 2.0 license and can be used at no cost; a managed TiDB Cloud service also offers a free tier.

Project at a glance

Active
Stars
39,614
Watchers
39,614
Forks
6,098
LicenseApache-2.0
Repo age10 years old
Last commit13 hours ago
Primary languageGo

Last synced 12 hours ago