TDengine TSDB High Availability Architecture

Juno Qiu

June 22, 2026 /

High availability is a core requirement for production TSDB deployments. TDengine TSDB supports service continuity through multi-replica mechanisms, automatic failover, and operational controls for recovery and load distribution.

High availability architecture

Architecture components

A typical deployment places a load balancer layer (Nginx/HAProxy) above three taosd nodes (Node1, Node2, Node3), which connect to a multi-replica storage layer.

Replica strategy

Two SQL examples illustrate the setup:

  • Create a database with three replicas and 10 vgroups: CREATE DATABASE demo REPLICA 3 VGROUPS 10;
  • Check vnode status: SHOW VNODES;

Multi-replica mechanism

Replica types

TDengine supports three replica synchronization modes:

ModeBehaviorBest for
Strong syncAll replicas must confirm writes before returningCore business systems
Weak syncOnly the primary replica must confirmPerformance-prioritized workloads
AsyncPrimary returns immediately without waitingLog-type data

Leader election

TDengine uses the Raft protocol for leader election. Three key properties define this process:

  1. Automatic election of a new leader when the current leader fails
  2. Automatic data synchronization across replicas
  3. Transparency to applications. No application-side changes are required

Automatic failover

Fault detection

Run SHOW DNODES; to check node status. Each dnode reports one of three states: offline, online, or syncing.

Fault recovery process

The recovery sequence follows five steps:

  1. Detect node failure (within 3 seconds)
  2. Mark the node as offline
  3. Automatically elect a new leader
  4. Sync data to the replacement node
  5. Restore service

Recovery time objectives

ScenarioRTORPO
Single node failure< 30 seconds0
Network partition< 1 minute< 1 minute

Load balancing

Vgroup load balancing

Two SQL commands manage load distribution:

  • Trigger rebalancing: BALANCE VGROUP;
  • View cluster state: SHOW CLUSTER;

Write load distribution

The load balancer distributes write requests using three strategies: round-robin, least-connections, and IP hash.

Network configuration

Network isolation

Use separate dedicated networks for cluster internal communication, client access, and storage (distributed storage).

Network quality requirements

MetricRequirement
Bandwidth10-gigabit network
Latency< 1ms
Packet loss rate< 0.01%

Capacity planning

Replica count selection

Business gradeReplicasRationale
Core business3High availability for production workloads
General business2Balance between cost and availability
Development/testing1Development and test environments only

Node planning

Production deployments need at least three nodes. This supports three-replica deployment, ensures majority quorum elections, and eliminates single points of failure.

Summary

Five practices form the foundation of a production-ready TDengine high availability deployment:

  1. Choose replica strategies that match the workload
  2. Verify network quality before production rollout
  3. Set up monitoring and alerting
  4. Run regular failover drills
  5. Maintain disaster recovery and restoration plans