简体   繁体   English

Postgres异步复制

[英]Postgres Asynchronous replication

i have an RoR application working with a Postgres database. 我有一个使用Postgres数据库的RoR应用程序。 This is working in a local computer for local network clients. 这适用于本地网络客户端的本地计算机。 But i want to add a database on the cloud mirroring the local database. 但我想在镜像本地数据库的云上添加一个数据库。 But there is a problem, sometimes here the internet goes down, so the local service can continue working but the database on the cloud would be waiting from the next time the local database connect to internet to sync the changes. 但是存在一个问题,有时候互联网会出现故障,因此本地服务可以继续工作,但是下一次本地数据库连接到互联网以同步更改时,云上的数据库将会等待。

I have been reading about synchronous replication but i dont think it would work in this case. 我一直在阅读有关同步复制的内容,但我不认为它会在这种情况下起作用。 So async replication could help but which choose (slony, buscardo, pglogical)? 所以异步复制可以帮助但是哪个选择(slony,buscardo,pglogical)?

Can i accomplish this? 我可以做到这一点吗?

UPDATE UPDATE

If i use async replication with slony or bucardo, will they keep trying to send the changes to the cloud database when internet is not available or will they send the changes and fail and no try anymore (In this case the cloud database will have incorrect data since that event)? 如果我使用slony或bucardo进行异步复制,他们会在互联网不可用时继续尝试将更改发送到云数据库,还是会发送更改并失败,不再尝试(在这种情况下,云数据库将包含不正确的数据)既然那个事件)?

Ummh, I am afraid sync replication is not an option here. 嗯,我恐怕同步复制不是一个选择。 Even your local and your cloud are up an running, sync replication will slow down your local database due to your network latency. 即使您的本地和您的云正在运行,同步复制也会因您的网络延迟而降低本地数据库的速度。 Only choice is async replication and you have to wait for your cloud database to catch up your local db in case of internet connection is disconnected. 唯一的选择是异步复制,如果互联网连接断开,您必须等待云数据库赶上本地数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM