复制数据库更改
我想将数据库“复制”到外部服务。为此,我可以复制整个数据库(SELECT * FROM TABLE)。
如果进行了一些更改(INSERT、UPDATE、DELETE),我是否需要再次上传整个数据库或者有一个描述这些操作的日志文件?
谢谢!
I want to "replicate" a database to an external service. For doing so I could just copy the entire database (SELECT * FROM TABLE).
If some changes are made (INSERT, UPDATE, DELETE), do I need to upload the entire database again or there is a log file describing these operations?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您的“外部服务”不仅仅是另一个数据库,因此传统的复制可能不适合您。有关该服务的更多详细信息将非常有用,以便我们可以定制答案。根据您需要将数据获取到外部服务的时间和应用程序的性能要求,一些主要选项是:
更新您的外部服务
当你的数据改变时的数据(这
您的应用程序可能会很粗糙
性能但提供接近
为您的外部提供实时数据
服务)
如果您选择触发器,您也许能够调整现有的基于触发器的复制解决方案来更新外部服务。我没有使用过这些,所以我不知道这会有多疯狂,只是一个想法。一些例子是 Bucardo 和 懒惰。
It sounds like your "external service" is not just another database, so traditional replication might not work for you. More details on that service would be great so we can customize answers. Depending on how long you have to get data to your external service and performance demands of your application, some main options would be:
that update your external service's
data when your data changes (this
could be rough on your app's
performance but provide near
real-time data for your external
service)
If you choose triggers, you may be able to tweak an existing trigger-based replication solution to update your external service. I haven't used these so I have no idea how crazy that would be, just an idea. Some examples are Bucardo and Slony.
复制 PostgreSQL 数据库的方法有很多。在当前的 9.0 版本中,PostgreSQL 全球开发小组引入了两个新的岩石特性,称为热备和流复制,将 PostgreSQL 提升到了一个新的水平,并引入了内置解决方案。
在 wiki 上,有对 PostgreSQL-9.0 新功能的完整评论:
http://wiki.postgresql.org/wiki/PostgreSQL_9.0
还有其他应用程序像 Bucardo、Slony-I、Londiste (Skytools) 等,您也可以使用。
现在,您想对日志处理做什么?你到底想要什么?问候
There are many ways to replicate a PostgreSQL database. In the current version 9.0 the PostgreSQL Global Development Group introduced two new rocks features called Hot Standby and Streaming Replication puting to PostgreSQL to a new level and introducing a built-in solution.
On the wiki, there is a completed review of the new PostgreSQL-9.0´s features:
http://wiki.postgresql.org/wiki/PostgreSQL_9.0
There are other applications like Bucardo, Slony-I, Londiste (Skytools), etc,which you can use too.
Now, What are you want to do for log processing? What do you want exactly ? regards