# `3-DC` Deployment Solution: `HA`

![`smart`](3DCDeploymentHA_aa_001_20221025.png)

------------------------------------------------------------
Pros:
- A replica of all data is distributed across 3 data centers. After any data center fails, the other two data centers will automatically initiate a `leader` election and recover service within a reasonable period of time (usually within 20 seconds), without data loss.

Cons:
- Performance is affected by network latency.

For the write scenario, all written data needs to be synchronously replicated to at least 2 data centers. Since the `TiDB` write process uses `2-phase` commit, the write delay requires at least 2 times the inter-data center delay.

For read request, if the data leader is not in the same data center as the `TiDB` node that initiated the read, it will also be affected by network delays.

Every transaction in `TiDB` needs to obtain `TSO` from the `PD` leader. When `TiDB` and `PD` leader are not in the same data center, transactions running on `TiDB` will also be affected by network delays as a result, and each transaction with a write will get `TSO` twice.
