Skip to main content

High Availability

TDengine TSDB is a distributed time-series database with built-in high availability (HA). By default, it uses a standard three-replica architecture based on the RAFT protocol. To better fit different deployment scenarios, TDengine also offers a two-replica RAFT-based option, as well as an active-active solution using WAL data synchronization for users who prefer a traditional primary-standby setup.

  • Three-replica architecture: Stores three copies of each dataset, delivering the highest level of availability at the highest cost.
  • Dual-replica with arbitrator: Stores two copies of each dataset, but requires at least three nodes in the cluster. This reduces storage costs compared to three replicas while still ensuring strong consistency and high availability.
  • Active-active: Runs with just two nodes. This setup provides good availability but only guarantees eventual consistency.

The key differences between these three approaches are outlined below:

#Three-ReplicaDual-ReplicaActive-Active
Cluster setupSingle clusterSingle clusterTwo independent clusters
Minimum nodesThree data nodesTwo data nodes and one arbitrator nodeTwo data nodes
Leader electionRaft algorithmArbitrator-managedNot applicable
Replication methodRaft algorithmRaft algorithmtaosX
Sync latencyNoneNoneDepends on taosX; typically seconds
Data durabilityNo data lossNo data lossDepends on WAL retention
Data consistencyStrong (Raft)Strong (Raft)Eventual
AvailabilityService unaffected if any single node failsService unaffected if a single node fails, but cannot tolerate consecutive failuresService remains available as long as one instance is alive