简体   繁体   English

哪个数据库对复制具有最佳支持

[英]Which database has the best support for replication

I have a fairly good feel for what MySQL replication can do. 我对MySQL复制可以做的事情有一个相当不错的感觉。 I'm wondering what other databases support replication, and how they compare to MySQL and others? 我想知道其他数据库支持复制,以及它们与MySQL和其他数据库的比较?

Some questions I would have are: 我会遇到的一些问题是:

  1. Is replication built in, or an add-on/plugin? 是内置复制,还是附加/插件?
  2. How does the replication work (high-level)? 复制如何工作(高级)? MySQL provides statement-based replication (and row-based replication in 5.1). MySQL提供基于语句的复制(以及5.1中基于行的复制)。 I'm interested in how other databases compare. 我对其他数据库的比较感兴趣。 What gets shipped over the wire? 什么通过电线发货? How do changes get applied to the replicas? 如何将更改应用于副本?
  3. Is it easy to check consistency between master and slaves? 检查主站和从站之间的一致性是否容易?
  4. How easy is it to get a failed replica back in sync with the master? 将失败的副本与主服务器同步恢复是多么容易?
  5. Performance? 性能? One thing I hate about MySQL replication is that it's single-threaded, and replicas often have trouble keeping up, since the master can be running many updates in parallel, but the replicas have to run them serially. 我讨厌MySQL复制的一件事是它是单线程的,并且副本经常无法跟上,因为master可以并行运行许多更新,但副本必须以串行方式运行它们。 Are there any gotchas like this in other databases? 在其他数据库中有没有这样的问题?
  6. Any other interesting features... 任何其他有趣的功能......

MySQL's replication is weak inasmuch as one needs to sacrifice other functionality to get full master/master support (due to the restriction on supported backends). MySQL的复制很弱,因为需要牺牲其他功能来获得完全的主/主支持(由于受支持的后端的限制)。

PostgreSQL's replication is weak inasmuch as only master/standby is supported built-in (using log shipping); PostgreSQL的复制很弱,因为只有内置支持主/备用(使用日志传送); more powerful solutions (such as Slony or Londiste) require add-on functionality. 更强大的解决方案(如Slony或Londiste)需要附加功能。 Archive log segments are shipped over the wire, which are the same records used to make sure that a standalone database is in working, consistent state on unclean startup. 存档日志段通过线路传送,这些记录与用于确保独立数据库在不干净启动时处于工作,一致状态的记录相同。 This is what I'm using presently, and we have resynchronization (and setup, and other functionality) fully automated. 这就是我目前正在使用的,我们完全自动化了重新同步(和设置,以及其他功能)。 None of these approaches are fully synchronous. 这些方法都不是完全同步的。 More complete support will be built in as of PostgreSQL 8.5. 从PostgreSQL 8.5开始,将构建更完整的支持。 Log shipping does not allow databases to come out of synchronization, so there is no need for processes to test the synchronized status; 日志传送不允许数据库不同步,因此不需要进程来测试同步状态; bringing the two databases back into sync involves setting the backup flag on the master, rsyncing to the slave (with the database still runnning; this is safe), and unsetting the backup flag (and restarting the slave process) with the archive logs generated during the backup process available; 使两个数据库重新同步包括在主服务器上设置备份标志,rsyncing到从服务器(数据库仍然运行;这是安全的),并使用在生成期间生成的存档日志取消设置备份标志(并重新启动从属进程)备份过程可用; my shop has this process (like all other administration tasks) automated. 我的商店有自动化这个过程(像所有其他管理任务一样)。 Performance is a nonissue, since the master has to replay the log segments internally anyhow in addition to doing other work; 性能是一个非问题,因为除了做其他工作之外,主人必须在内部重播日志段。 thus, the slaves will always be under less load than the master. 因此,奴隶的负荷总是低于船长。

Oracle's RAC (which isn't properly replication, as there's only one storage backend -- but you have multiple frontends sharing the load, and can build redundancy into that shared storage backend itself, so it's worthy of mention here) is a multi-master approach far more comprehensive than other solutions, but is extremely expensive. Oracle的RAC(没有正确复制,因为只有一个存储后端 - 但是你有多个前端共享负载,并且可以在共享存储后端本身构建冗余,所以这里值得一提)是一个多主机方法远比其他解决方案更全面,但是非常昂贵。 Database contents aren't "shipped over the wire"; 数据库内容不是“通过网络发送”; instead, they're stored to the shared backend, which all the systems involved can access. 相反,它们被存储到共享后端,所涉及的所有系统都可以访问该后端。 Because there is only one backend, the systems cannot come out of sync. 因为只有一个后端,系统不能不同步。

Continuent offers a third-party solution which does fully synchronous statement-level replication with support for all three of the above databases; Continuent提供第三方解决方案,可完全同步语句级复制,并支持上述所有三个数据库; however, the commercially supported version of their product isn't particularly cheap (though vastly less expensive. Last time I administered it, Continuent's solution required manual intervention for bringing a cluster back into sync. 然而,他们产品的商业支持版本并不是特别便宜(虽然价格便宜得多。上次我管理它时,Continuent的解决方案需要手动干预才能使群集恢复同步。

I have some experience with MS-SQL 2005 (publisher) and SQLEXPRESS (subscribers) with overseas merge replication. 我对MS-SQL 2005(发布者)和SQLEXPRESS(订阅者)有一些海外合并复制的经验。 Here are my comments: 以下是我的评论:

1 - Is replication built in, or an add-on/plugin? 1 - 内置复制,还是附加/插件?

Built in 内置

2 - How does the replication work (high-level)? 2 - 复制如何工作(高级)?

Different ways to replicate, from snapshot (giving static data at the subscriber level) to transactional replication (each INSERT/DELETE/UPDATE instruction is executed on all servers). 从快照(在订户级别提供静态数据)到事务复制(每个INSERT / DELETE / UPDATE指令在所有服务器上执行)的不同复制方式。 Merge replication replicate only final changes (successives UPDATES on the same record will be made at once during replication). 合并复制仅复制最终更改(复制期间将立即在同一记录上成功更新)。

3 - Is it easy to check consistency between master and slaves? 3 - 检查主站和从站之间的一致性是否容易?

Something I have never done ... 我从未做过的事......

4 - How easy is it to get a failed replica back in sync with the master? 4 - 将失败的副本与主服务器同步恢复是多么容易?

The basic resynch process is just a double-click one .... But if you have 4Go of data to reinitialize over a 64 Kb connection, it will be a long process unless you customize it. 基本的重新同步过程只需双击即可....但如果你有4Go数据重新初始化64 Kb连接,除非你自定义它,否则它将是一个漫长的过程。

5 - Performance? 5 - 表现?

Well ... You will of course have a bottleneck somewhere, being your connection performance, volume of data, or finally your server performance. 那么......你当然会遇到瓶颈,包括你的连接性能,数据量,或者最后你的服务器性能。 In my configuration, users only write to subscribers, which all replicate with the main database = publisher. 在我的配置中,用户只写入订阅者,这些订阅者都使用main database = publisher进行复制。 This server is then never sollicited by final users, and its CPU is strictly dedicated to data replication (to multiple servers) and backup. 然后,该服务器永远不会被最终用户所吸引,并且其CPU严格专用于数据复制(到多个服务器)和备份。 Subscribers are dedicated to clients and one replication (to publisher), which gives a very interesting result in terms of data availability for final users. 订阅者专注于客户端和一个复制(发布者),这为最终用户的数据可用性提供了非常有趣的结果。 Replications between publisher and subscribers can be launched together. 发布者和订阅者之间的复制可以一起启动。

6 - Any other interesting features... 6 - 任何其他有趣的功能......

It is possible, with some anticipation, to keep on developping the database without even stopping the replication process....tables (in an indirect way), fields and rules can be added and replicated to your subscribers. 有一些预期,可以继续开发数据库,​​甚至不用停止复制过程....表(以间接方式),字段和规则可以添加并复制到您的订阅者。

Configurations with a main publisher and multiple suscribers can be VERY cheap (when compared to some others...), as you can use the free SQLEXPRESS on the suscriber's side, even when running merge or transactional replications 主发布者和​​多个嫌疑人的配置非常便宜(与其他人相比......),因为即使在运行合并或事务复制时,您也可以在suscriber一侧使用免费的SQLEXPRESS

尝试使用Sybase SQL Anywhere

Just adding to the options with SQL Server (especially SQL 2008, which has Change Tracking features now). 只需添加SQL Server的选项(特别是SQL 2008,它现在具有更改跟踪功能)。 Something to consider is the Sync Framework from Microsoft. 需要考虑的是Microsoft的Sync Framework There's a few options there, from the basic hub-and-spoke architecture which is great if you have a single central server and sometimes-connected clients, right through to peer-to-peer sync which gives you the ability to do much more advanced syncing with multiple 'master' databases. 有一些选项,从基本的中心辐射式架构,如果你有一个中央服务器和有时连接的客户端,直到对等同步,这使你能够做得更高级与多个“主”数据库同步。

The reason you might want to consider this instead of traditional replication is that you have a lot more control from code, for example you can get events during the sync progress for Update/Update, Update/Delete, Delete/Update, Insert/Insert conflicts and decide how to resolve them based on business logic, and if needed store the loser of the conflict's data somewhere for manual or automatic processing. 您可能需要考虑此而不是传统复制的原因是您可以从代码中获得更多控制权,例如,您可以在更新/更新,更新/删除,删除/更新,插入/插入冲突的同步过程中获取事件并根据业务逻辑决定如何解决它们,如果需要,可以将冲突数据的输出存储在某处以进行手动或自动处理。 Have a look at this guide to help you decide what's possible with the different methods of replication and/or sync. 请查看本指南,以帮助您确定使用不同复制和/或同步方法的可能性。

For the keen programmers the Sync Framework is open enough that you can have the clients connect via WCF to your WCF Service which can abstract any back-end data store (I hear some people are experimenting using Oracle as the back-end). 对于敏锐的程序员来说,Sync Framework足够开放,您可以让客户端通过WCF连接到您的WCF服务,后者可以抽象任何后端数据存储(我听说有些人正在尝试使用Oracle作为后端)。

My team has just gone release with a large project that involves multiple SQL Express databases syncing sub-sets of data from a central SQL Server database via WAN and Internet (slow dial-up connection in some cases) with great success. 我的团队刚刚发布了一个大项目,涉及多个SQL Express数据库,通过WAN和Internet(在某些情况下,慢速拨号连接)同步来自中央SQL Server数据库的数据子集,取得了巨大成功。

MS SQL 2005 Standard Edition and above have excellent replication capabilities and tools. MS SQL 2005 Standard Edition及更高版本具有出色的复制功能和工具。 Take a look at: 看一眼:

http://msdn.microsoft.com/en-us/library/ms151198(SQL.90).aspx http://msdn.microsoft.com/en-us/library/ms151198(SQL.90).aspx

It's pretty capable. 它很有能力。 You can even use SQL Server Express as a readonly subscriber. 您甚至可以将SQL Server Express用作只读订阅者。

There are a lot of different things which databases CALL replication. 数据库CALL复制有很多不同的东西。 Not all of them actually involve replication, and those which do work in vastly different ways. 并非所有这些实际上都涉及复制,以及那些以完全不同的方式工作的复制。 Some databases support several different types. 一些数据库支持几种不同类型。

MySQL supports asynchronous replication, which is very good for some things. MySQL支持异步复制,这对某些事情非常有用。 However, there are weaknesses. 但是,存在缺陷。 Statement-based replication is not the same as what most (any?) other databases do, and doesn't always result in the expected behaviour. 基于语句的复制与大多数(任何?)其他数据库的复制不同,并不总是导致预期的行为。 Row-based replication is only supported by a non production-ready version (but is more consistent with how other databases do it). 基于行的复制仅由非生产就绪版本支持(但与其他数据库的执行方式更为一致)。

Each database has its own take on replication, some involve other tools plugging in. 每个数据库都有自己的复制,有些涉及其他工具插入。

有点偏离主题,但您可能想查看Maatkit以获取有助于MySQL复制的工具。

All the main commercial databases have decent replication - but some are more decent than others. 所有主要的商业数据库都有不错的复制 - 但有些比其他更好。 IBM Informix Dynamic Server (version 11 and later) is particularly good. IBM Informix Dynamic Server(版本11及更高版本)特别好。 It actually has two systems - one for high availability (HDR - high-availability data replication) and the other for distributing data (ER - enterprise replication). 它实际上有两个系统 - 一个用于高可用性(HDR-高可用性数据复制),另一个用于分发数据(ER-企业复制)。 And the the Mach 11 features (RSS - remote standalone secondary, and SDS - shared disk secondary) are excellent too, doubly so in 11.50 where you can write to either the primary or secondary of an HDR pair. 而Mach 11的功能(RSS - 远程独立辅助,SDS - 共享磁盘辅助)也非常出色,在11.50中你可以写入HDR对的主要或辅助。

( Full disclosure: I work on Informix softare. ) 完全披露:我在使用Informix softare。

我自己没有尝试过,但你可能也想看看OpenBaseSQL,它似乎有一些简单易用的内置复制。

Another way to go is to run in a virtualized environment. 另一种方法是在虚拟化环境中运行。 I thought the data in this blog article was interesting 我认为这篇博客文章中的数据很有趣

http://chucksblog.typepad.com/chucks_blog/2008/09/enterprise-apps.html http://chucksblog.typepad.com/chucks_blog/2008/09/enterprise-apps.html

It's from an EMC executive, so obviously, it's not independent, but the experiment should be reproducible 它来自EMC执行官,显然,它不是独立的,但实验应该是可重复的

Here's the data specific for Oracle 这是Oracle特有的数据

http://oraclestorageguy.typepad.com/oraclestorageguy/2008/09/to-rac-or-not-to-rac-reprise.html http://oraclestorageguy.typepad.com/oraclestorageguy/2008/09/to-rac-or-not-to-rac-reprise.html

Edit: If you run virtualized, then there are ways to make anything replicate 编辑:如果您运行虚拟化,那么有一些方法可以进行任何复制

http://chucksblog.typepad.com/chucks_blog/2008/05/vmwares-srm-cha.html http://chucksblog.typepad.com/chucks_blog/2008/05/vmwares-srm-cha.html

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

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