# Three data centers within the Same City (B)

+ Features:
  + Data replica spread across 3 data centers or availability zone
  + Lower latency in the same city network
  + Multiactivity characteristics
  + Low RTO, 0 RPO
+ Question:
  + High latency for writing and reading
------------------------------------------------------------


Features:
1. All data replica are spread across 3 data centers or availability zone. (Raft tends to have an odd number of replica)
2. The same city network has easy latency (less than 1.5 ms) and bandwidth of 10 megabits.
3. Services are available from each data center. (more active)
4. When either datacenter fails, the other two automatically initiate a leader election and recover to service for a reasonable period of time (typically up to 20s) with no data loss, resulting in a low RTO (30 seconds) and an RPO of 0.

Disadvantages:
1. For the write scenario, all written data needs to be replicated to at least 2 data centers synchronously. Since the TiDB write process uses 2-phase commit, the write latency needs to be at least twice the data center latency. 
2. 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 latency. 
3. Every transaction in TiDB needs to obtain a TSO from the PD leader. When TiDB and PD leader are not in the same data center,

Transactions running on it will also be affected by network latency, and each transaction that has a write will get two TSO.
