将旧数据库用于CRUD和新数据库,以接收相同的数据
这是我要解决的任务 - 我们有一个使用数据库(a)的服务器,以及使用该的应用程序,现在我需要使用新数据库(b)创建一个新服务器,并且具有与(a)相同的数据)具有相同的关系和ID和其他所有内容。关键是我需要使用(a)作为crud和b来接收数据,因此它们始终应该相同(同步)。实现这种逻辑和连接的最佳方法和实践是什么? 到目前为止,我以这种方式考虑:创建一个(a)的转储,然后在(b)=&gt中还原;当(a)中的crud数据crud数据以(b)中的数据更新数据时,请使用兔子或kafka之类的东西。但是我在这里看到一些缺点:如果(b)中的数据未更新怎么办?我知道我们在使用队列时已经进行了重试,但这并不意味着(b)中正在更新100%的数据。以及当服务器(b)压碎时如何处理此类情况,但是(a)仍能正常工作并且处理crud =>这会导致数据不一致? 如果有帮助 - 使用Nodejs Frameworks创建了PostgreSQL和服务器应用程序。
Here is the task I want to solve - we have a server using database (A) and the application that uses that, now I need to create a new server with the new database (B) and have the same data as in the (A) with the same relations and ids and everything else. The point is I need to use (A) for CRUD and B for receiving data, so they always should be the same (synced). What is the best way and practice to achieve such logic and connection?
So far I think about this way: create a dump of (A), then restore in (B) => use something like RabbitMQ or Kafka when CRUD data in (A) to update data in (B). But I see some cons here: what if data in (B) are not updated? I know we have Retries when using queues but it doesn't mean that for a 100% data are being updated in (B). And how to handle such cases when server (B) crushed but (A) is still working correctly and handling CRUD => which causes data inconsistency?
If that helps - databases PostgreSql and server apps are created using Nodejs frameworks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 pg逻辑复制
You can use PG logical replication