Self-host tidb
v8.5.8Distributed SQL database for transactions, analytics and AI
- Stars
- 40 734
- CPU
- 16 core+ (per TiDB instance)
- RAM
- 48 GB+ (per TiDB instance)
- Storage
- SSD
- Ports
- 4000 (MySQL protocol endpoint for applications and DBA tools), 10080 (HTTP status, metrics and pprof endpoint)
- Requires
- TiKV
pingcap/tidbWhat is tidb?
TiDB comes from PingCAP and is a distributed SQL database released under Apache 2.0, built for high availability, elastic scale and strong consistency. A running cluster pairs a stateless SQL layer (tidb-server) speaking the MySQL wire protocol with TiKV for row storage, while an optional TiFlash column engine turns the same cluster into an HTAP system; PD acts as the cluster brain and serves the TiDB Dashboard admin UI. Typical uses include MySQL modernization, multi-region transactional systems, and agent-context or vector-search workloads. Self-hosting runs through TiUP on Linux (a playground command for quick tests, topology files for production), or through TiDB Operator on Kubernetes; the SQL endpoint is port 4000. Expect a real footprint: production guidance asks for at least two TiDB, three PD and three TiKV instances. TiDB Cloud exists for those who prefer a managed service.
tidb alternatives
oceanbaseSelf-hosted, open-source distributed SQL database that is MySQL compatible and handles OLTP plus real-time HTAP analytics, vector and full-text search in one engine.Compareoceanbase with tidb
tdengineSelf-hosted open-source time-series database for IoT and industrial data, offering clustering, stream processing, subscriptions, TDgpt AI and Grafana or Kafka links.Comparetdengine with tidb
cratedbA self-hosted, open-source distributed SQL database with PostgreSQL wire protocol support, for real-time analytics over time-series, full-text and vector data.Comparecratedb with tidb
LibreDB StudioSelf-hosted, open-source SQL IDE covering 41 database engines in one browser tab, with OIDC SSO, RBAC, query auditing and an AI query agent — MIT licensed.CompareLibreDB Studio with tidb
databendSelf-hosted, open-source data warehouse in Rust for large-scale analytics plus vector and full-text search, with Python UDF sandboxes and git-like data branching.Comparedatabend with tidb
gtsdbGTSDB is a self-hosted, open-source time-series database in Go using WAL-first architecture for sub-millisecond reads and 233x faster writes than InfluxDB.Comparegtsdb with tidb
questdbSelf-hosted, open-source time-series database with SAMPLE BY and ASOF join SQL, QuestDB Wire Protocol ingestion, PGWire support and a web console.Comparequestdb with tidb
dgraphA horizontally scalable GraphQL database for self-hosted terabyte-scale data. Native GraphQL API with ACID transactions, full-text search, deployed via Docker or source.Comparedgraph with tidb
Should you self-host tidb?
tidb scores 80/100 on selfhost.directory (how scoring works) and ranks #4 of 38 in Databases. It has 40 734 GitHub stars, +103 in the last 30 days.
It shipped 2 stable releases in the past year. The latest, v8.5.8, came out on 27 August 2026. New versions land roughly every 2 months.
Setup is advanced: plan for several services and some ongoing maintenance. An official Docker image is available. It is Apache-2.0-licensed and written mostly in Go.
Its closest alternative on selfhost.directory is Redis (86/100, 77 490 stars). It scores higher overall, so compare the two before you pick. See tidb vs Redis side by side.
Features
- Change data capture
- Distributed ACID transactions
- Geographic replica placement
- High availability with automatic failover (Raft)
- Horizontal and vertical scaling without downtime
- HTAP (row + columnar storage)
- Kubernetes deployment
- MySQL Compatibility
- Online DDL
- REST API
- TLS Encryption
- Vector Search
- Web-based Admin Dashboard
tidb README
TiDB (/’taɪdiːbi:/, "Ti" stands for Titanium) is an open-source, cloud-native, distributed SQL database designed for high availability, horizontal and vertical scalability, strong consistency, and high performance.
-
Distributed Transactions: TiDB uses a two-phase commit protocol to ensure ACID compliance, providing strong consistency. Transactions span multiple nodes, and TiDB's distributed nature ensures data correctness even in the presence of network partitions or node failures.
-
Horizontal and Vertical Scalability: TiDB can be scaled horizontally by adding more nodes or vertically by increasing resources of existing nodes, all without downtime. TiDB's architecture separates computing from storage, enabling you to adjust both independently as needed for flexibility and growth.
-
High Availability: Built-in Raft consensus protocol ensures reliability and automated failover. Data is stored in multiple replicas, and transactions are committed only after writing to the majority of replicas, guaranteeing strong consistency and availability, even if some replicas fail. Geographic placement of replicas can be configured for different disaster tolerance levels.
-
Hybrid Transactional/Analytical Processing (HTAP): TiDB provides two storage engines: TiKV, a row-based storage engine, and TiFlash, a columnar storage engine. TiFlash uses the Multi-Raft Learner protocol to replicate data from TiKV in real time, ensuring consistent data between the TiKV row-based storage engine and the TiFlash columnar storage engine. The TiDB Server coordinates query execution across both TiKV and TiFlash to optimize performance.
-
Cloud-Native: TiDB can be deployed in public clouds, on-premises, or natively in Kubernetes. TiDB Operator helps manage TiDB on Kubernetes, automating cluster operations, while TiDB Cloud provides a fully-managed service for easy and economical deployment, allowing users to set up clusters with just a few clicks.
-
MySQL Compatibility: TiDB is compatible with MySQL 8.0, allowing you to use familiar protocols, frameworks and tools. You can migrate applications to TiDB without changing any code, or with minimal modifications. Additionally, TiDB provides a suite of data migration tools to help easily migrate application data into TiDB.
-
Open Source Commitment: Open source is at the core of TiDB's identity. All source code is available on GitHub under the Apache 2.0 license, including enterprise-grade features. TiDB is built with the belief that open source enables transparency, innovation, and collaboration. We actively encourage contributions from the community to help build a vibrant and inclusive ecosystem, reaffirming our commitment to open development and accessibility for everyone.
-
Start a TiDB cluster.
-
On local playground. To start a local test cluster, refer to the TiDB quick start guide.
-
On Kubernetes. TiDB can be easily deployed in a self-managed Kubernetes environment or Kubernetes services on public clouds using TiDB Operator. For more details, refer to the TiDB on Kubernetes quick start guide.
-
Using TiDB Cloud (recommended). TiDB Cloud offers a fully managed version of TiDB with a free plan, no credit card required, so you can get a free cluster in seconds and start easily: Sign up for TiDB Cloud.
-
-
Learn about TiDB SQL: To explore the SQL capabilities of TiDB, refer to the TiDB SQL documentation.
-
Use a MySQL driver or an ORM to Build an App with TiDB.
-
Explore key features, such as data migration, changefeed, vector search, HTAP, disaster recovery, etc.
-
You can connect with TiDB users, ask questions, find answers, and help others on our community platforms: Discord, Slack (English, Japanese), Stack Overflow, TiDB Chinese Forum, X @PingCAP
-
For filing bugs, suggesting improvements, or requesting new features, use Github Issues or join discussions on Github Discussions.
-
To troubleshoot TiDB, refer to Troubleshooting documentation.
Learn more details about TiDB architecture in our Docs.
TiDB is built on a commitment to open source, and we welcome contributions from everyone. Whether you are interested in improving documentation, fixing bugs, or developing new features, we invite you to shape the future of TiDB.
-
See our Contributor Guide and TiDB Development Guide to get started.
-
If you're looking for issues to work on, try looking at the good first issues or help wanted issues.
-
The contribution map lists everything you can contribute.
-
The community repository contains everything else you need.
-
Don't forget to claim your contribution swag by filling in and submitting this form.
TiDB is under the Apache 2.0 license. See the LICENSE file for details.
FAQ
What environments support TiDB Self-Managed?
You can deploy TiDB on bare metal, VMs, Kubernetes via TiDB Operator, hybrid cloud and multi-region setups.
How does TiDB achieve high availability?
Through Raft-based replication, automatic failover, multi-AZ redundancy and continuous data protection, so node failures do not impact application uptime.
Is TiDB a MySQL-compatible database?
Yes. TiDB supports MySQL syntax, drivers and ecosystem tools, so clients need no schema rewrites or logic changes and MySQL migrations are straightforward.
Does TiDB support horizontal scaling?
Yes. You can add compute or storage nodes at any time and TiDB rebalances data and queries automatically, with no downtime and no manual partitioning.
Is TiDB a self-managed database?
Yes — TiDB can run fully self-managed, giving you complete control over infrastructure, networking, security and upgrades, on-premises, in a private cloud or across regions.
More in Databases
Tile38Self-hosted, open-source in-memory geolocation store and spatial index with real-time geofencing, webhook alerts and a Redis-compatible API.
timeplusSelf-hosted, open-source streaming SQL engine for real-time analytics and AI — a lightweight alternative to ksqlDB and Flink powered by ClickHouse.
timescaleTimescaleDB is an open-source, self-hosted PostgreSQL extension for time-series and event data, with hypertables, columnar compression, and continuous aggregates.
ValkeySelf-hosted, open-source Valkey is an in-memory key-value database for caching, queues and primary data, with replication, Sentinel failover and cluster sharding.
VectorChordSelf-hosted PostgreSQL extension for scalable vector search using RaBitQ quantization, compatible with pgvector syntax, enabling 100M+ vectors on modest hardware.
victoriametricsOpen-source, self-hosted time series database and monitoring backend that replaces Prometheus or Graphite as Grafana's metrics store, with PromQL and MetricsQL querying.
yantrikdb-serverSelf-hosted memory DB for AI agents with recall, graph, contradiction detection, decay. Embedded lib, MCP server, or replicated cluster.
AntflyAntfly is a self-hosted, open-source Zig database unifying full-text, vector, and graph search with built-in ML for embeddings, reranking, and RAG.
Apache CassandraSelf-hosted, open-source distributed NoSQL database: a masterless partitioned row store with multi-datacenter replication, queried with CQL over the native protocol.
Apache CouchDBSelf-hosted, open-source Apache CouchDB is a document database with an HTTP/JSON API, bi-directional replication for offline-first sync, and multi-server clustering.
Apache IoTDBApache IoTDB is a self-hosted, open-source time-series database for industrial IoT with high-throughput reads/writes, ultra-high compression, and SQL-like queries.
arangodbSelf-hosted multi-model database for documents, graphs and key-values, queried in one AQL language; the open-source Community edition is free for non-commercial use.


0 comments