# TiDB

> An open-source, cloud-native distributed SQL database with ACID guarantees, horizontal scalability, HTAP, and native vector search for transactional and AI workloads.

TiDB (pronounced "tie-dee-bee," where "Ti" stands for Titanium) is an open-source distributed SQL database built by PingCAP and released under the Apache 2.0 license. It is designed for high availability, horizontal scalability, strong consistency, and hybrid transactional/analytical processing (HTAP). The core repository on GitHub has accumulated over 40,000 stars and is written primarily in Go.

## What It Is

TiDB is a cloud-native distributed SQL database that separates compute from storage, enabling independent scaling of both layers. It is MySQL 8.0-compatible, meaning existing applications can migrate with minimal or no code changes. The database supports ACID-compliant distributed transactions via a two-phase commit protocol, and its built-in Raft consensus protocol provides automated failover and data replication across multiple nodes. TiDB can be deployed on-premises, in Kubernetes via TiDB Operator, or as a fully managed service through TiDB Cloud.

## HTAP Architecture

TiDB's hybrid engine is a defining architectural feature. It ships two storage backends:

- **TiKV** — a row-based storage engine optimized for transactional workloads
- **TiFlash** — a columnar storage engine for analytical queries

TiFlash uses the Multi-Raft Learner protocol to replicate data from TiKV in real time, keeping both engines consistent. The TiDB Server coordinates query execution across both engines, routing row lookups to TiKV and aggregations to TiFlash without requiring ETL pipelines or a separate data warehouse.

## Agentic AI and Vector Search

PingCAP has positioned TiDB as a purpose-built database for agentic AI workloads. The platform supports native vector indexing and retrieval-augmented generation (RAG) pipelines, allowing vector similarity queries to be joined directly against transactional data in a single SQL call. The homepage states that TiDB provides agent state that is ACID-consistent across workflow steps, with concurrent agents reading identical state regardless of which node they hit. Developer integrations include an MCP server, the `pytidb` library, LangChain, and LlamaIndex. TiDB Cloud also supports instant database branching and scale-to-zero for idle clusters, which the product page describes as suited to unpredictable agentic workload patterns.

## Deployment Options

TiDB is available in three deployment modes:

- **TiDB Cloud** — a fully managed SaaS offering with autoscaling, multi-AZ high availability, and a free-tier cluster requiring no credit card
- **TiDB Self-Managed** — deployed on bare metal, VMs, or Kubernetes using TiDB Operator
- **Local playground** — a single-node test cluster for development and evaluation

The self-managed path supports both horizontal scaling (adding nodes) and vertical scaling (increasing node resources) with no downtime. Online DDL changes allow schema evolution without stopping the cluster.

## Update: TiDB v8.5.6

The latest release listed on GitHub is **v8.5.6**, published on April 14, 2026. The repository remains actively maintained, with the last push recorded on June 20, 2026. The project's GitHub topics include `agent`, `agent-memory`, `agentic`, `htap`, `serverless`, and `mysql-compatibility`, reflecting the current product direction toward agentic AI infrastructure alongside its established distributed SQL capabilities.

## Open-Source Commitment

PingCAP states that all TiDB source code — including enterprise-grade features — is available on GitHub under the Apache 2.0 license. The project actively accepts community contributions and maintains a contributor guide, a development guide, and a contribution map. As of the latest data, the repository has over 6,100 forks and more than 6,300 open issues, indicating a broad contributor base.

## Features
- Distributed ACID transactions
- Horizontal and vertical scalability
- High availability via Raft consensus
- HTAP with TiKV (row) and TiFlash (columnar) engines
- MySQL 8.0 compatibility
- Native vector search and RAG pipelines
- Autoscaling and scale-to-zero
- Instant database branching
- Online DDL with zero downtime
- Multi-tenant workload isolation
- MCP server integration
- LangChain and LlamaIndex integrations
- Kubernetes deployment via TiDB Operator
- Fully managed TiDB Cloud option
- Disaster recovery with geographic replica placement

## Integrations
LangChain, LlamaIndex, pytidb, MCP (Model Context Protocol), Kubernetes / TiDB Operator, MySQL drivers and ORMs, Amazon Web Services, TiKV, TiFlash, Dify, Manus

## Platforms
WEB, API, CLI, DEVELOPER_SDK

## Pricing
Open Source, Free tier available

## Version
v8.5.6

## Links
- Website: https://www.tidb.io/
- Documentation: https://docs.pingcap.com/tidb/stable
- Repository: https://github.com/pingcap/tidb
- EveryDev.ai: https://www.everydev.ai/tools/tidb
