tidb

module
v1.1.0-beta.0...-eecbd4b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2026 License: Apache-2.0

README

TiDB

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.

Key Features

  • 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.

Quick Start

  1. 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.

  2. Learn about TiDB SQL: To explore the SQL capabilities of TiDB, refer to the TiDB SQL documentation.

  3. Use a MySQL driver or an ORM to Build an App with TiDB.

  4. Explore key features, such as data migration, changefeed, vector search, HTAP, disaster recovery, etc.

Need Help?

Architecture

TiDB architecture

Learn more details about TiDB architecture in our Docs.

Contributing

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.

Active Contributors of pingcap/tidb - Last 28 days

License

TiDB is under the Apache 2.0 license. See the LICENSE file for details.

See Also

Acknowledgments

Directories

Path Synopsis
br
cmd/br command
pkg/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
pkg/mock/mocklocal
Code generated by MockGen.
Code generated by MockGen.
pkg/stream/crr/internal/checkpoint
Package checkpoint computes a downstream-safe checkpoint for CRR.
Package checkpoint computes a downstream-safe checkpoint for CRR.
pkg/utils/storewatch
package storewatch provides a `Watcher` type which allows the user to listen the events of lifetime of stores.
package storewatch provides a `Watcher` type which allows the user to listen the events of lifetime of stores.
tests command
tests/br_rawkv command
tests/br_txn command
debug-linter command
cmd
benchdb command
benchkv command
benchraw command
importer command
mirror command
pluginpkg command
tidb-server command
dumpling
cli
cmd/dumpling command
log
tests/s3 command
lightning
pkg/importer/opts
Package opts contains all kinds of options definitions that can affect the behavior of restore & get infos.
Package opts contains all kinds of options definitions that can affect the behavior of restore & get infos.
pkg/importinto/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
parser module
pkg
config/deploymode
Package deploymode stores the process-wide deployment mode for TiDB X (NextGen) deployments.
Package deploymode stores the process-wide deployment mode for TiDB X (NextGen) deployments.
config/kerneltype
Package kerneltype provides the kernel type of TiDB.
Package kerneltype provides the kernel type of TiDB.
ddl
Package ddl is the core of TiDB DDL layer.
Package ddl is the core of TiDB DDL layer.
ddl/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
ddl/systable
Package systable contains all constants/methods related accessing system tables related to DDL job execution
Package systable contains all constants/methods related accessing system tables related to DDL job execution
domain/sqlsvrapi/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
dxf/example
Package example is an example application of DXF.
Package example is an example application of DXF.
dxf/framework
Package framework contains all the codes related to DXF.
Package framework contains all the codes related to DXF.
dxf/framework/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
dxf/framework/mock/execute
Package mockexecute is a generated GoMock package.
Package mockexecute is a generated GoMock package.
dxf/framework/scheduler/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
dxf/importinto/conflictedkv
Package conflictedkv provides the functionality to handle KVs due to conflicted rows when importing data into TiDB using the ImportInto statement.
Package conflictedkv provides the functionality to handle KVs due to conflicted rows when importing data into TiDB using the ImportInto statement.
dxf/importinto/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
extworkload
Package extworkload exposes a Manager that lets TiDB coordinate background workloads (GCV2, TTL, and auto-analyze) with an external workload controller.
Package extworkload exposes a Manager that lets TiDB coordinate background workloads (GCV2, TTL, and auto-analyze) with an external workload controller.
extworkload/client
Package client is the gRPC client to the external workload controller.
Package client is the gRPC client to the external workload controller.
format/textrow
Package textrow holds the MySQL text-protocol value serializer.
Package textrow holds the MySQL text-protocol value serializer.
importsdk/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
inference/domainadaptor
Package domainadaptor provides access to Domain-owned inference resources without importing the domain package and creating a dependency cycle.
Package domainadaptor provides access to Domain-owned inference resources without importing the domain package and creating a dependency cycle.
inference/embedding/internal/testutil
Package testutil provides shared contract tests and fixtures for embedding provider adapters.
Package testutil provides shared contract tests and fixtures for embedding provider adapters.
ingestor
Package ingestor provides the interface to ingest SSTs directly to the underlying storage layer, and also provides the utilities to
Package ingestor provides the interface to ingest SSTs directly to the underlying storage layer, and also provides the utilities to
ingestor/ingestcli/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
keyspace
Package keyspace provides utilities for keyspace for nextgen TiDB.
Package keyspace provides utilities for keyspace for nextgen TiDB.
kv
meta/tidbvar
Package tidbvar contains variable definition related to mysql.tidb table.
Package tidbvar contains variable definition related to mysql.tidb table.
objstore/mockobjstore
Package mockobjstore is a generated GoMock package.
Package mockobjstore is a generated GoMock package.
objstore/ossstore/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
objstore/s3like/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
objstore/s3store/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
planner/core
Package core Copyright 2022 PingCAP, Inc.
Package core Copyright 2022 PingCAP, Inc.
planner/core/resolve
Package resolve is used for semantic resolve of the AST tree.
Package resolve is used for semantic resolve of the AST tree.
resourcegroup/ruv2
Package ruv2 defines the raw units and weighting model used to calculate RU v3.
Package ruv2 defines the raw units and weighting model used to calculate RU v3.
store/pdtypes
Package pdtypes contains type defines under PD.
Package pdtypes contains type defines under PD.
util/dbutil/dbutiltest
Package dbutiltest is a package for some common used methods for db related testing.
Package dbutiltest is a package for some common used methods for db related testing.
util/mock
Package mock is just for test only.
Package mock is just for test only.
util/sem/compat
Package compat provides compatibility functions for different versions of SEM
Package compat provides compatibility functions for different versions of SEM
util/sqlexec/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
util/topsql/stmtstats
Package stmtstats provides statement statistics collection.
Package stmtstats provides statement statistics collection.
workloadlearning
Package workloadlearning implements the Workload-Based Learning Optimizer.
Package workloadlearning implements the Workload-Based Learning Optimizer.
parser module
tests
llmtest command
tools
check command
check/xprog command
fake-oauth command
gen-parquet command
patch-go command
tazel command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL