简体   繁体   English

跨多个平台维护多个数据库

[英]Maintaining Multiple Databases Across Several Platforms

What's the best way to maintain a multiple databases across several platforms (Windows, Linux, Mac OS X and Solaris) and keep them in sync with one another? 在多个平台(Windows,Linux,Mac OS X和Solaris)上维护多个数据库并使它们彼此同步的最佳方法是什么? I've tried several different programs and nothing seems to work! 我尝试了几种不同的程序,但似乎没有任何效果!

I think you should ask yourself why you have to go through the hassle of maintaining multiple databases across several platforms and have them in sync with one another. 我认为您应该问自己,为什么必须经历在多个平台上维护多个数据库并使它们彼此同步的麻烦。 Sounds like there's a lot of redundancy there. 听起来那里有很多冗余。 Why not just have one instance of that database, since I'm sure it can be made accessible (eg via SOA approach) to multiple apps on multiple platforms anyway? 为什么不能只拥有该数据库的一个实例,因为我确信无论如何它都可以被多个平台上的多个应用程序访问(例如,通过SOA方法)?

Why go through the hassle? 为什么要经历麻烦? Management claims it's more expensive? 管理层声称价格更高?

Here's how to prove them wrong. 这是证明他们错误的方法。

Pick one database, call it the "master" or "system of record". 选择一个数据库,将其称为“主数据库”或“记录系统”。

Write scripts to export data from the master and load it into your copies. 编写脚本以从母版导出数据并将其加载到副本中。 If you have a nice database (MySQL, SQL/Server, Oracle or DB2) there are nice tools to do this replication for you. 如果您有一个不错的数据库(MySQL,SQL / Server,Oracle或DB2),那么可以使用不错的工具为您执行此复制。 If you have a mixture of databases, you'll have to resort to exporting changed data and reloading changed data. 如果混合使用数据库,则必须诉诸导出更改的数据并重新加载更改的数据。 The idea is that this is a 1-way copy: master to replicants. 这个想法是,这是一种1向复制:复制主体。

Fix each application, one at a time, to do updates in the master database only. 一次修复每个应用程序,以仅在master数据库中进行更新。 Since each application has a JDBC (or ODBC or whatever) connection to a database, it can just as easily be a connection to the master database. 由于每个应用程序都具有到数据库的JDBC(或ODBC或其他)连接,因此可以轻松地与主数据库建立连接。

Once you've fixed the applications to update only the master, the replicas are worthless. 固定应用程序以仅更新主数据库之后,副本就一文不值了。 Management can insist that it's cheaper to have them. 管理层可以坚持认为拥有它们会更便宜。 And there they are -- clones of the master database -- just what management says you must have. 在那里,他们是-主数据库的克隆-正是管理层说,你必须具备

Your life is simpler because the apps are only updating the system of record. 您的生活更加简单,因为这些应用程序仅在更新记录系统。 They're happy because you have all the cloned databases lying around. 他们很高兴,因为您拥有所有克隆的数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM