我想让我的主Postgres DB(在Heroku上托管)复制到我笔记本电脑上的从属DB。 这可能吗?
Heroku的文档讨论了Heroku中托管的主服务器和从服务器: https : //devcenter.heroku.com/articles/heroku-postgres-follower-databases
有人问是否有可能让Heroku外面的主人和Heroku内部的奴隶(不是): 从Heroku跟随外部数据库
我还没有看到相反的答案 - 让Heroku的主人和外面的奴隶。
我为什么要这个? 加快发展。 我的应用程序在本地运行,数据库在云端运行,往返时间很长,因此数据访问速度很慢。 大多数数据访问都是只读的。 如果我可以有一个本地奴隶,它会显着加快速度。
相关:如果我的笔记本电脑断开了一段时间怎么办? 这会给主人带来麻烦吗?
I'd like to have my master Postgres DB, which is is hosted on Heroku, replicate down to a slave DB on my laptop. Is this possible?
Heroku's documentation talks about both master and slave hosted within Heroku: https://devcenter.heroku.com/articles/heroku-postgres-follower-databases
Someone else asked whether it's possible to have the master outside Heroku and a slave inside Heroku (it's not): Follow external database from Heroku
I haven't seen an answer for the reverse -- having the master in Heroku and the slave outside.
Why do I want this? To speed up development. With my app running locally and the DB in the cloud, the round-trip is long so data access is slow. Most data access is read-only. If I could have a local slave, it would speed things up significantly.
Related: what if my laptop is disconnected for a while? Would that cause problems for the master?
最满意答案
你不能在Heroku网络之外建立一个追随者(奴隶) - 追随者需要超级用户访问创建,Heroku Postgres不会为你提供,所以你只能在Heroku上运行一个追随者。
如果您想在本地下载一份副本以供使用/检查,您可以使用pgbackups来执行此操作: https ://devcenter.heroku.com/articles/heroku-postgres-import-export
You cannot make a follower (slave) outside of the Heroku network – followers need superuser access to create, which Heroku Postgres doesn't provide you, so you are limited to running a follower on Heroku.
If you want to pull down a copy locally for use/inspection, you can do so with pgbackups: https://devcenter.heroku.com/articles/heroku-postgres-import-export
更多推荐
发布评论