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.
Raft and High Availability
Choosing the Right Enterprise-Grade Disaster Recovery Solution for the Financial Industry
How TiKV Reads and Writes
A fully-managed cloud DBaaS for predictable workloads
A fully-managed cloud DBaaS for auto-scaling workloads