0

I currently have two SOA applications (soa1 and soa2), each with their own database. I would like to create a third application (report1) which somehow merges these databases and provides reports. I was thinking, if I could get soa1 and soa2 to use WAL-E, then report1 could potentially become a read slave and I could use a multi-tenant solution.

I want to join data across soa1 and soa2, so it's important that I have access to both in a single query.

There are three ways I think I can do this

  1. Take my databases off of heroku, setup three databases on my own (ick)
  2. Magically have one database instance on heroku follow soa1 and soa2
  3. Leave everything as it is and inject data into queries, using CTE (also ick)

I don't even know if I can have two separate WALs read into a database, under different schemas... But if I can, I assume I'll have to go with option 1, because I assume heroku doesn't support what I want to do...

Barring all of that, does anyone have any other thoughts on how this could be accomplished?

4

1 回答 1

3

你不能用 PostgreSQL 的内置二进制复制来做到这一点。它不能合并多个存档流,也不太可能这样做。

我们正在研究可以做到这一点的逻辑复制(我现在正在对其进行测试),但它需要 PostgreSQL 的补丁,并且在 PostgreSQL 9.4 之前(9.3 即将推出)之前,未修补的 PostgreSQL 将无法使用它。

同时,您可以使用 Bucardo、Slony-I 等基于触发器的复制解决方案来完成此类任务。这在 Heroku 上可能具有挑战性,因为您不能直接在 Heroku 数据库实例上运行自己的进程;您可能必须从您自己的服务器远程运行复制代理。

于 2013-05-08T00:21:22.897 回答