100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Database

TiDB

By PingCAP

AdvancedService5.9K learners

TiDB is an open-source, distributed SQL database developed by PingCAP that is MySQL-compatible and designed for Hybrid Transactional/Analytical Processing (HTAP), letting the same cluster serve both transactional and analytical queries.

Definition

TiDB is an open-source, distributed SQL database developed by PingCAP that is MySQL-compatible and designed for Hybrid Transactional/Analytical Processing (HTAP), letting the same cluster serve both transactional and analytical queries.

Overview

TiDB separates a database into distinct layers so each can scale independently: a stateless SQL layer that speaks the MySQL wire protocol, a distributed transactional key-value storage layer (TiKV, built in Rust) that replicates data using the Raft consensus algorithm for strong consistency, and an optional columnar storage layer (TiFlash) that serves analytical queries without slowing down transactional workloads. Because the storage layer is distributed and horizontally scalable by design, TiDB can grow by adding more nodes rather than requiring the manual sharding schemes that traditional MySQL setups often need at large scale. Its MySQL compatibility means many existing applications, ORMs, and tools can connect to TiDB with little or no code change, easing migration from traditional MySQL deployments that have outgrown a single server. The HTAP design is TiDB's key differentiator: rather than running a separate data warehouse pipeline to analyze transactional data, TiFlash replicates data in a columnar format in near real time, so analytical queries (large aggregations, reporting) can run directly against fresh operational data. TiDB is often deployed on Kubernetes using its own operator, and is commonly compared to other distributed SQL systems like CockroachDB.

Key Features

  • MySQL wire-protocol compatibility for easy migration and tooling reuse
  • Distributed, horizontally scalable storage layer (TiKV) using the Raft consensus protocol
  • Separate columnar storage layer (TiFlash) for real-time analytical queries
  • Hybrid Transactional/Analytical Processing (HTAP) without separate ETL pipelines
  • Strong consistency and distributed ACID transactions across nodes
  • Horizontal scalability by adding nodes rather than manual sharding
  • Kubernetes-native deployment via the TiDB Operator
  • Available self-hosted or as a managed cloud service (TiDB Cloud)

Use Cases

Scaling MySQL-compatible applications beyond a single server without manual sharding
Running real-time analytics directly against live transactional data
Financial services and e-commerce systems needing strong consistency at scale
Consolidating separate OLTP and OLAP systems into a single HTAP database
Global, geographically distributed applications requiring high availability
Migrating legacy MySQL deployments that have outgrown vertical scaling

Frequently Asked Questions