TiDB

active

by PingCAP · since 2017 · also known as TiDB Cloud, PingCAP TiDB

MySQL-compatible distributed SQL with a row store for OLTP and a columnar replica for real-time analytics.

relationaldocumentcolumnar / olapvectordatabase engineopen source (permissive)mature

Overview

TiDB is an open-source distributed SQL database from PingCAP that speaks the MySQL protocol, keeps data in TiKV (a Raft-replicated, range-sharded key-value store written in Rust) and optionally mirrors tables into TiFlash columnar replicas for analytical queries. That split lets one cluster serve transactional traffic and fresh analytics without an ETL pipeline. It is the most common landing spot for teams outgrowing sharded MySQL who want to keep MySQL drivers and tooling. TiDB Cloud adds a serverless Starter tier with a free allowance and built-in vector search for AI workloads.

Strengths & trade-offs

Strengths

  • +MySQL protocol and dialect compatibility eases migration from sharded MySQL
  • +TiFlash columnar replicas give real-time analytics on fresh OLTP data without ETL
  • +Independent scaling of SQL compute and storage layers
  • +Online DDL and stale-read/flashback queries for operational safety
  • +Apache 2.0 license with a large production footprint

Trade-offs

  • −No triggers, stored procedures or foreign-key-heavy MySQL features in self-managed builds
  • −Many components (PD, TiKV, TiFlash, TiCDC) to operate when self-hosting
  • −Small clusters carry high fixed overhead compared with a single MySQL node
  • −Hotspot writes on monotonically increasing keys need AUTO_RANDOM or careful design

Great for

  • +Replacing hand-sharded MySQL
  • +HTAP dashboards on live transactional data
  • +SaaS platforms with very large tenant counts
  • +Payment and order systems at internet scale
  • +AI apps storing vectors next to relational data (TiDB Cloud)

Think twice for

  • −Apps that depend on MySQL triggers or stored procedures
  • −Tiny workloads that fit on one MySQL instance
  • −Heavy full-text search on self-managed clusters

Capabilities

Native or official first-party support · 15 of 25 tracked

✓Transactions
✓Joins
✓Secondary indexes
✓Vector search
✓JSON
✓Change data capture
✓TTL / expiry
✓Columnar storage
✓Durable persistence
✓Compression
✓Encryption at rest
✓Role-based access
✓Time travel
✓Branching
✓Online schema changes
–Full-text search
–Geospatial
–Triggers
–Stored procedures
–Materialized views
–Pub/Sub
–In-memory
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Massive · Multi-PB
Horizontal scaling
Native
Multi-region
Read replicas
Transactions
Full ACID
Consistency
Strong
Schema
Strict
Architecture
Distributed, Client server, Serverless
Query languages
SQL

Compute (TiDB) and storage (TiKV/TiFlash) scale independently; multi-region deployments use Raft placement rules or TiCDC replication.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

available on · AWS · Google Cloud · Azure · Alibaba Cloud

Ecosystem

compatible withMySQL
apis & protocolsMySQL wire protocol, TiDB Cloud Data Service (HTTP)
client languagesJava, Go, Python, JavaScript, C#, Ruby, PHP, Rust
used byPinterest, Plaid, Bolt

Alternatives to TiDB

Compare all→
MySQLRelational82.3

The web's default open-source SQL database, now on calendar versioning with 9.7 as the LTS line.

tidb vs mysql →
VitessRelational21.2

CNCF-graduated sharding and clustering layer that makes a fleet of MySQL servers look like one database.

tidb vs vitess →
CockroachDBRelational47.1

Postgres-wire distributed SQL built to survive node, zone and region failures with serializable transactions.

tidb vs cockroachdb →
OceanBaseRelational19.4

Alipay-proven distributed SQL with MySQL (and Oracle, in Enterprise) compatibility, HTAP and vector search.

tidb vs oceanbase →
SingleStoreRelational29.0

Distributed SQL running transactions, analytics, vector and full-text search in one engine on live data.

tidb vs singlestore →
PlanetScaleRelational25.7

Performance-focused managed MySQL (Vitess) and Postgres, with NVMe-backed Metal clusters and branching.

tidb vs planetscale →

TiDB FAQ

What is TiDB?

TiDB is a relational database by PingCAP, first released in 2017. TiDB is an open-source distributed SQL database from PingCAP that speaks the MySQL protocol, keeps data in TiKV (a Raft-replicated, range-sharded key-value store written in Rust) and optionally mirrors tables into TiFlash columnar replicas for analytical queries. That split lets one cluster serve transactional traffic and fresh analytics without an ETL pipeline. It is the most common landing spot for teams outgrowing sharded MySQL who want to keep MySQL drivers and tooling. TiDB Cloud adds a serverless Starter tier with a free allowance and built-in vector search for AI workloads.

Is TiDB open source?

Yes. TiDB is open source. License: Apache License 2.0.

Does TiDB support ACID transactions?

Yes. TiDB supports full ACID transactions, with strong consistency.

Does TiDB scale horizontally?

TiDB scales horizontally out of the box, with built-in sharding or partitioning. It is comfortable at massive scale (Multi-PB). It supports cross-region read replicas.

How can I run TiDB?

You can self-host it, use the vendor's managed cloud and run it serverless. Managed offerings include TiDB Cloud. It is available on AWS, Google Cloud, Azure and Alibaba Cloud.

What is TiDB best for?

TiDB is a strong fit for replacing hand-sharded MySQL, HTAP dashboards on live transactional data and SaaS platforms with very large tenant counts. Think twice for apps that depend on MySQL triggers or stored procedures.

What are the best alternatives to TiDB?

Common alternatives to TiDB include MySQL, Vitess, CockroachDB, OceanBase and SingleStore. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is TiDB?

TiDB ranks #56 of 844 databases on the WhichDB Score (35.9/100), and #16 among relational databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.