是否有可能让Heroku Postgres数据库复制到笔记本电脑上的从属数据库?(Is it possible to have a Heroku Postgres DB replicate down

编程入门 行业动态 更新时间:2024-10-27 11:28:38
是否有可能让Heroku Postgres数据库复制到笔记本电脑上的从属数据库?(Is it possible to have a Heroku Postgres DB replicate down to a slave DB on my laptop?)

我想让我的主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

更多推荐

本文发布于:2023-08-04 18:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1420675.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库   有可能   笔记本电脑   Postgres   Heroku

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!