High Availability in TiDB

TiDB uses Raft protocol to create a high availability environment, ensuring that your data is always accessible. Even with high availability, it maintains consistency of data across all nodes and delivers continuous access.

Standard Raft uses a Leader and Follower approach to maintain availability. If the Leader fails, a Follower is automatically put forth to be designated as the new Leader. The Leader is then responsible for validating data consistency across nodes. In TiDB, an additional designation of Learner is included into Raft. A Learner node is like a Follower, but it can never be put up for election as a Leader. Since the initial write to the database is always done to a node running TiKV as opposed to TiFlash, designating TiFlash nodes as Leaners prevents them from ever being promoted to a Leader role.

TiDB high availability provides

  • Continuous data access
  • Automatic recovery of a failed node
  • Assured data consistency across all nodes

TiDB delivers a high availability environment along with data consistency to provide ongoing, reliable, accurate data access.

Case Study

Goodbye, MySQL Sharding: Use a Scale-Out MySQL Alternative to Store 160+ TB of Data

This post talks about how TiDB, a highly available MySQL alternative, helps 58.com avoid MySQL sharding, scale out their databases, and simplify their database maintenance.

TiDB Cloud logo-black

TiDB Cloud

Get the massive scale and resiliency of TiDB databases in a fully managed cloud service

TiDB logo-black

TiDB

TiDB is effortlessly scalable, open, and trusted to meet the real-time needs of the digital enterprise

Documentation

Access tutorials, guides, release notes, and more

View Docs
Community

Join our community to connect with TiDB contributors from around the world

Community
FAQs

Check out TiDB and TiDB Cloud Frequently Asked Questions

FAQs