# Postgres stretched cluster along with Temporal stretched cluster across 2 DCs with ~7ms latency

**URL:** <https://community.temporal.io/t/postgres-stretched-cluster-along-with-temporal-stretched-cluster-across-2-dcs-with-7ms-latency/2990>\
**Category:** Community Support\
**Tags:** postgresql\
**Created:** [September 21, 2021, 5:24pm UTC](https://community.temporal.io/t/postgres-stretched-cluster-along-with-temporal-stretched-cluster-across-2-dcs-with-7ms-latency/2990 "2021-09-21T17:24:28Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![seb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/seb/32/992_2.png) [@seb](https://community.temporal.io/u/seb)\
**Post date:** [September 21, 2021, 5:24pm UTC](https://community.temporal.io/t/postgres-stretched-cluster-along-with-temporal-stretched-cluster-across-2-dcs-with-7ms-latency/2990/1 "2021-09-21T17:24:28Z")

</div>

Dear Temporal team,

I went through a lot of threads related to cross DCs setup but still need some advices…

Let me start with 2 requirements/constraints:

- data loss is not affordable so data consistency is the priority
- RTO has to be close to 0 but still, less important than consistency

Given that:

- we have 2 datacenters (not in public cloud)
- the latency between our 2 DCs is less than 10ms (~6ms avg)
- Postgres stretch cluster with synchronous replication is available (we use a 3rd DC for etcd for the quorum to avoid split brain)

My understanding is that:

- Because of the strong consistency requirement, multi-cluster replication is not an option
- It is NOT possible to have 2 separate Temporal clusters (up and active/active or active/passive) with the same database

So, we would like to setup a Temporal stretched cluster…

In this scenario, we have a single Temporal Cluster spanning across our 2 DCs.  
The whole cluster relies on our Postgres stretched cluster for persistence (it would also work with Cassandra is need be).

Question:

1. Is this a viable option?
2. With only 2 DCs for Temporal, is it split brain resistant. In this case, I am assuming that the DB is still up and running but the communication between the Temporal nodes in both DCs is broken but the nodes on both sides can read/write into the DB.  
Would you have an idea of what would happen…
3. If not split brain resistant, is there a way to make it split brain resistant with 2 DCs or any thought on how to mitigate the risk?

It seems that this is what’s discussed in this thread (not 100% sure): [temporal-with-mysql-how-to-survive-master-slave-failovers](https://community.temporal.io/t/temporal-with-mysql-how-to-survive-master-slave-failovers/)

Many thanks in advance for your support.  
Best regards, Seb.

---

_[View the full topic](https://community.temporal.io/t/postgres-stretched-cluster-along-with-temporal-stretched-cluster-across-2-dcs-with-7ms-latency/2990)._
