# Discourse synchronisation for multiple instances

**URL:** https://meta.discourse.org/t/discourse-synchronisation-for-multiple-instances/138227
**Category:** Development
**Created:** [January 10, 2020, 9:25am UTC](https://meta.discourse.org/t/discourse-synchronisation-for-multiple-instances/138227 "2020-01-10T09:25:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Surendra-Patil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/surendra-patil/32/147391_2.png) [@Surendra-Patil](https://meta.discourse.org/u/Surendra-Patil)
#### Post date: [January 10, 2020, 9:25am UTC](https://meta.discourse.org/t/discourse-synchronisation-for-multiple-instances/138227/1 "2020-01-10T09:25:49Z")

</div>

I have a master server and I will be having more than 100-200 slave instance. Slave instance can be online/offline but will be used by users. But whenever an offline instance comes online it should be able to sync with master server without creating conflicts and all update all the latest data. I do not want to create any code related changes as discourse keeps updating itself quite often and don’t want to break instance due to code changes.

I am thinking of tweaking postgresql to some extent. Other files related data can be synced using [syncthing](https://syncthing.net/). But updating postgresql data is something which worries me because if i directly sync master data then the work done by offline user will get erased after the sync.

I am thinking to try changing auto-increment sequence of every table to UUID in database.

Is there any possible easy solution for the same ?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [January 10, 2020, 11:08am UTC](https://meta.discourse.org/t/discourse-synchronisation-for-multiple-instances/138227/2 "2020-01-10T11:08:12Z")

</div>

Discourse is not designed for an application like this. It is extremely unlikely you will be able to get two-way postgres synchronisation working in a way that doesn’t break Discourse.

> [@Surendra-Patil](#):
>
> I am thinking to try changing auto-increment sequence of every table to UUID in database.

Changing this would require some significant changes in the Discourse code.

> [@Surendra-Patil](#):
>
> Slave instance can be online/offline but will be used by users. But whenever an offline instance comes online it should be able to sync with master server without creating conflicts and all update all the latest data.

If you make the slaves read-only, and synchronise postgres one-way, then it might be possible to make this work… but it will be difficult

---

<div class="post-metadata">

### Author: ![pi88](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pi88/32/270964_2.png) [@pi88](https://meta.discourse.org/u/pi88)
#### Post date: [August 19, 2022, 7:31am UTC](https://meta.discourse.org/t/discourse-synchronisation-for-multiple-instances/138227/3 "2022-08-19T07:31:35Z")

</div>

Hi, I plan to have similar kind of usage as you. I found an article about merging 2 discourse site. If the merging steps can be automated, maybe we can setup a cron job to constantly merge the database between the master server and slave instances?

> [@Merge two Discourse sites into one](https://meta.discourse.org/t/merge-two-discourse-sites-into-one/95435/1):
>
> If you have two Discourse sites that you wish were one, this guide is for you.
> 
> * * *
> 
> _Last Reviewed by @AlexDev on 2022-07-13T00:00:00Z_
