Free audit

View Audit Scope
JusDBRaft replicas · PD quorum · Placement rules · TiCDC standby · BR

TiDB high availability across zones, tested in drills.

JusDB designs and tests TiDB high availability: Raft replicas of every Region spread across zones with location labels and placement rules, a PD quorum that survives a zone loss, TiDB servers behind a load balancer, a TiCDC standby cluster where you need one, and BR restores rehearsed before you need them. 24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins.
The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed.
  • NDA before access
  • Read-only review first
  • Drills run in windows you approve

tidb_availability

TiKV

One per zone, set by location labels

Every placement change is proposed, approved, and checked with pd-ctl.

P1 response SLA
15 mins
Critical, 24/7
P2 response SLA
30 mins
High, 24/7
P3 response SLA
60 mins
Medium, 24/7
After each drill
Written result
What happened, what we measured, and fixes

Selected clients

  • Innoviti
  • Blitz
  • Freecharge
  • Nango
  • Recochain
  • Screen Facts
  • Nexora
  • WeCredit

Failure modes

What fails in a TiDB cluster, and what we set up for it.

TiDB handles many failures on its own through Raft. Whether it does on your cluster depends on labels, capacity, and how your application reconnects.

A TiDB server stops

TiDB servers hold no data, so the load balancer sends new connections to the others. Open sessions on the failed server end, and any transaction in flight on them is lost.
We check health probes on the load balancer and test that your connection pools reconnect and retry. TiProxy keeps sessions only through planned restarts and scale-in, not a crash.

A TiKV node fails

For each Region it led, the surviving replicas elect a new Raft leader and requests retry against it. If the node stays down past max-store-down-time (30m by default), PD rebuilds its replicas on other nodes.
We keep enough free disk and CPU on the remaining TiKV nodes to take those replicas, and alert on Regions with a missing replica.

The PD leader fails

The other PD members elect a new leader. Every transaction needs a timestamp from the PD leader, so new transactions wait until the election finishes.
We run three or five PD members in separate zones, check that the leader sits near the TiDB servers, and set leader priorities where it should stay put.

A whole zone goes down

With three zones, three replicas, and correct labels, each Region keeps two of three replicas and stays writable. Without labels, PD can place two replicas of a Region in one zone.
We set location-labels and isolation-level in PD, match them to each TiKV node's labels, and confirm the spread with pd-ctl before relying on it.

A TiFlash node fails

TiFlash replicas are asynchronous Raft learners, so writes and transactional reads on TiKV carry on. Queries that depend on that table's columnar replica lose it until it is rebuilt.
We set two TiFlash replicas, on separate nodes, for tables that dashboards or reports depend on, and watch replica status in information_schema.

A Region loses most of its replicas

Raft cannot elect a leader, so that data is unavailable. Online Unsafe Recovery brings it back online but can lose data and leave indexes inconsistent.
We agree in advance when to use Online Unsafe Recovery and when to restore from BR instead, and run ADMIN CHECK TABLE afterward.

Topologies and recovery layers

Six designs we choose from, per workload.

Which ones you need depends on the failures you must survive and the write latency you can accept. Results depend on the workload; we baseline before and measure after each approved change.

Three zones in one region

The standard layout: TiKV, PD, and TiDB servers spread over three zones, so one zone can fail without losing a Raft majority.

  • Write latency includes the round trip between zones
  • Five replicas where you need to survive two failures at once
location-labels · isolation-level · max-replicas

Two zones with DR Auto-Sync

For sites with only two zones close together. PD keeps a replica in the second zone in sync while the link is healthy.

  • PingCAP sets limits: under 1.5 ms between zones, over 10 Gbps, under 50 km apart
  • Losing the primary zone needs a manual recovery, so we write and rehearse it
replication-mode · dr-auto-sync · pd-ctl

Primary and standby clusters

A second cluster in another region, fed by TiCDC. Replication is asynchronous, so the standby can lag the primary.

  • TiCDC redo log stored where it can be read if the primary region is lost
  • Tables without a primary key or non-null unique index are found first
TiCDC · redo log · changefeed lag

Placement rules in SQL

Placement policies keep leaders near the application and replicas in the zones or regions you choose, per table or partition.

  • TiFlash replicas are set with SET TIFLASH REPLICA, not placement policies
  • TiCDC ignores placement policies, so the standby needs its own
CREATE PLACEMENT POLICY · SHOW PLACEMENT

Backups and point-in-time restore

Replication copies a bad DELETE everywhere. BR snapshot and log backups are what bring the data back to a time before it.

  • Log backup started with br log start and checked for lag
  • Restores rehearsed with br restore point into a separate cluster
BR · log backup · Amazon S3 · GCS · Azure Blob Storage

TiDB Cloud

PingCAP runs the nodes. Dedicated and Premium spread them across zones, while Starter, and Essential in most regions, run in one zone.

  • Your application still has to reconnect after a failover
  • Restore tests and changefeeds to a standby remain your decision
TiDB Cloud Dedicated · Premium · changefeeds

Deployment limits from the PingCAP guides to three AZs in one region and two AZs with DR Auto-Sync, checked 27 November 2026.

How we check placement

Replica spread, placement, and TiFlash copies.

The first block reads and sets PD's replication settings; the second sets placement per table. Region names and labels are examples, and set commands run only after your approval.

01 · PD replication settings and replica health

PD="tiup ctl:v8.5.0 pd -u http://pd-1:2379"

# Replica count and the topology labels PD uses
$PD config show replication

# Keep replicas of a Region in separate zones (after approval)
$PD config set location-labels zone,host
$PD config set isolation-level zone

# Stores with their labels, and Regions missing a replica
$PD store
$PD region check miss-peer

# PD members and the current leader
$PD member

02 · Placement policy and TiFlash replicas

-- Five replicas, leaders in the region that serves the app.
-- MAJORITY_IN_PRIMARY keeps commits local, but the table
-- then cannot survive the loss of the whole primary region.
CREATE PLACEMENT POLICY orders_primary
  PRIMARY_REGION="us-east-1"
  REGIONS="us-east-1,us-west-2"
  FOLLOWERS=4
  SCHEDULE="MAJORITY_IN_PRIMARY";

ALTER TABLE orders PLACEMENT POLICY=orders_primary;
SHOW PLACEMENT FOR TABLE orders;

-- Two columnar copies for a table that dashboards read
ALTER TABLE orders SET TIFLASH REPLICA 2;
SELECT TABLE_NAME, REPLICA_COUNT, AVAILABLE, PROGRESS
  FROM information_schema.tiflash_replica;

Failover drills

Six drills that show the design works.

Each drill tests one part of the design. We run these in staging first, then in production windows you approve, and write down what we measured.

  1. Drill 1

    Stop a TiKV node

    We stop one TiKV node in staging and confirm that leaders move, the application keeps writing, and alerts fire.

  2. Drill 2

    Move the PD leader

    We transfer the PD leader and measure how long transactions wait for timestamps on your cluster.

  3. Drill 3

    Restart a TiDB server

    We restart one TiDB server under load and check whether connection pools reconnect and retry before errors reach users.

  4. Drill 4

    Isolate a zone

    In a staging cluster with the same labels, we cut one zone off and check that every Region keeps a majority.

  5. Drill 5

    Switch to the standby

    We follow the TiCDC standby runbook end to end and record the lag at the moment of the switch.

  6. Drill 6

    Restore to a point in time

    We restore a BR snapshot and log backup into a spare cluster and check row counts against the source.

SLA response times and ownership

Response times by severity, and who owns what.

Incidents on the clusters in scope get the SLA response times below. The lists after them show what your team keeps and what JusDB handles.

24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins. Our engineering team is in India (IST, UTC+5:30) and provides 24/7 support.

P1 · Critical

Production database down, primary unreachable, data corruption risk, or active failover event.

  • Response SLA: 15 mins
  • Coverage: 24/7

P2 · High

Severe latency spike, replication lag climbing rapidly, connection exhaustion, or degraded HA node.

  • Response SLA: 30 mins
  • Coverage: 24/7

P3 · Medium

Non-critical slow query regression, staging issue, backup warning, configuration question, or planned operational request.

  • Response SLA: 60 mins
  • Coverage: 24/7

Response means an on-call engineer is working the incident, not an automated reply. Support is 24/7.

Your team keeps
  • Set business priorities, application requirements, and release plans
  • Approve production changes, except routine actions you have pre-approved
  • Own your cloud accounts, access policies, and vendor relationships
  • Decide when maintenance can happen and how quickly service must recover
  • Move the work in-house or to another provider after your agreement's notice period, with your data returned or deleted and the transition help your agreement sets out (see Terms, section 8)
JusDB handles
  • Monitor database health, investigate alerts, and involve the right people
  • Review query performance, replication, capacity, and backup health
  • Carry out approved changes and update the operating instructions they affect
  • Report completed work, open risks, and recommended next steps

Ways to work with JusDB

Choose how our TiDB engineers back your team.

A scoped availability review and build, or ongoing operation with drills on a schedule. A monthly retainer for a set number of engineering hours, or a monthly fee per database instance, HA cluster, or region; projects are scoped and quoted separately.

Project

TiDB high availability

A read-only review, a written design, the placement and standby changes, and the first round of drills.

Ongoing

TiDB remote DBA

JusDB engineers run the cluster day to day, including restore tests and drills on a schedule you agree.

Kubernetes

TiDB on Kubernetes

Zone spread, storage, and failover for clusters run by TiDB Operator.

Procurement and security

Ready for legal and security review.

Mutual NDA before any access, least-privilege credentials in your vault, and security controls aligned with ISO 27001 and SOC 2 Type II.
  • Mutual NDA before any access
  • Named individual accounts only
  • Read-only access by default
  • ISO 27001 & SOC 2 Type II: aligned, certification in progress
  • Mutual NDA before any access

    We sign a mutual NDA before viewing schemas, logs, slow-query captures, or cloud topology.

  • Least-privilege, named credentials

    Engineers connect through your bastion, VPN, or SSM using named accounts with read-only permissions by default.

  • Change control & approval gates

    Production DDL, parameter changes, and failovers follow your change-management workflow with rollback steps prepared first.

  • Named leadership & direct escalation

    Engagements are led by named senior database reliability engineers in India with direct Slack, Teams, and PagerDuty channels.

TiDB high availability FAQ

Questions about TiDB availability.

Replica counts, zone failures, standby clusters, and what TiDB Cloud covers.

Still have a question?

Ask it on a scoping call. No production access needed.

Book a 30-min scoping call (opens Google Calendar in a new tab)

What does JusDB TiDB high availability work include?

JusDB TiDB high availability work covers replica placement across zones, PD quorum, load balancing for TiDB servers, TiFlash replica counts, a TiCDC standby cluster where you need one, BR backups with point-in-time restore, and rehearsed failover drills. We review the current cluster read-only first, then propose each change in writing for your approval.

How many replicas does TiDB keep, and what can it survive?

TiDB keeps three Raft replicas of every Region by default, set by max-replicas in PD. A Region stays writable while a majority of its replicas survive, so three replicas tolerate one failure and five tolerate two. That holds only when replicas sit in separate failure domains, which JusDB sets with location labels.

What happens to TiDB when a whole availability zone fails?

With three zones, three replicas, and correct location labels, each Region keeps two of its three replicas, so Raft elects new leaders in the surviving zones and the cluster keeps serving. PD members must also be spread across zones. JusDB checks the labels with pd-ctl and rehearses a zone loss in staging before you rely on it.

When do you add a TiCDC standby cluster?

JusDB adds a standby cluster in another region when you need to survive the loss of a whole region, or of both zones in a two-zone site. TiCDC replication is asynchronous, so the standby can lag the primary. We store the TiCDC redo log where it can be read after a disaster, and rehearse the switch.

TiDB migration

Does TiDB Cloud handle high availability for us?

TiDB Cloud runs the nodes and Raft failover. Dedicated and Premium spread nodes across zones, while Starter, and Essential in most regions, run in one zone. Your team still owns application reconnects, restore tests, and any standby cluster. JusDB reviews those against the TiDB Cloud plan you run.

What SLA response times apply to TiDB incidents?

24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins. Our engineering team is in India (IST, UTC+5:30) and provides 24/7 support. Response means an on-call engineer is working the incident, not an automated reply.

Related TiDB services

Other ways JusDB works on TiDB.

Migrations, day-to-day operation, Kubernetes, and architecture reviews.

Migration

TiDB migration

Moves from MySQL, RDS, and Aurora with DM, data checks, and a TiCDC rollback path.

Explore service
Ongoing

TiDB remote DBA

Day-to-day operation: monitoring, backups, upgrades, and incidents.

Explore service
Kubernetes

TiDB on Kubernetes

TiDB Operator, topology spread across zones, storage, and rolling upgrades.

Explore service
Architecture

TiDB consulting

Topology, workload fit, and TiDB Cloud decisions in a written recommendation.

Explore service
Guide

Raft replication in TiDB

Leader election, log replication, and Region splits explained.

Read the guide
All engines

Backup and disaster recovery

How JusDB plans backups and restores across every engine it supports.

Explore service

Related TiDB Services

Explore more ways our TiDB experts can help with your database infrastructure.

Test your TiDB failover

Know what your TiDB cluster survives.

A scoping call covers your topology, platforms, and the failures you need to survive. P1 response SLA: 15 mins, 24/7.