简体   繁体   English

SQL Server相当于MySQL多主复制?

[英]SQL Server equivalent of MySQL multi-master replication?

Is there an MSSQL equivalent of MySQL's multi-master replication? 是否有MSSQL相当于MySQL的多主复制? If so, is it available in SQL Express 2008? 如果是这样,它是否可以在SQL Express 2008中使用? I've also seen it referred to as two node circular replication. 我也看到它被称为双节点循环复制。

Basically, I have an in-office database that I want to be perfectly (relatively :) )in sync with a cloud database (we will have access via VPN). 基本上,我有一个办公室数据库,我想完美(相对:))与云数据库同步(我们将通过VPN访问)。 Reads and writes occur at both nodes. 两个节点都发生读写操作。

Peer-to-Peer Transactional Replication . 点对点事务复制 Is an Enterprise only feature. 是仅限企业版的功能。 Another option is an updatable subscription for Transactional Replication, see Updatable Subscriptions for Transactional Replication . 另一个选项是事务复制的可更新订阅,请参阅事务复制的可更新订阅 And finally you can roll your own using Service Broker , which is the only option which will work with an Express client, as long as the 'cloud' edition is non-Express. 最后,只要“云”版本不是Express,您就可以使用Service Broker自行推出,这是唯一可以与Express客户端配合使用的选项。

SQL Server 2008 Enterprise and Standard editions offer: SQL Server 2008企业版和标准版提供:

SQL Server 2008 Express has limited functionality with: SQL Server 2008 Express的具有有限功能:

In both cases, you'll need to write a customized solution. 在这两种情况下,您都需要编写自定义解决方案。

There is an excellent chapter in SQL Server MVP Deep Dives called "The Poor Man's SQL Server Log Shipping." SQL Server MVP Deep Dives中有一个很好的章节叫做“The Poor Man's SQL Server Log Shipping”。 It will take you through the entire process. 它将引导您完成整个过程。

When you say a cloud database, do you mean SQL Azure? 当你说一个云数据库时,你的意思是SQL Azure吗? If so, SQL Azure doesn't support replication. 如果是这样,SQL Azure不支持复制。

If your cloud database is a full copy of SQL Server (ie not Express) you can set up a transactional publication with updatable subscriptions, or use a merge publication. 如果您的云数据库是SQL Server的完整副本(即非Express),则可以使用可更新订阅设置事务发布,或使用合并发布。 Both options will let you synchronise changes in either database. 这两个选项都允许您同步任一数据库中的更改。

Edit 编辑

Just to clarify, you can use SQL Server Express for replication, but only as a subscriber. 只是为了澄清,您可以使用SQL Server Express进行复制,但仅作为订阅者使用。 The publisher needs to be Workgroup edition or above. 发布者需要是Workgroup版或更高版本。

In addition to what others have posted, I'd also mention merge replication, and an article on MSDN about Selecting the Appropriate Type of Replication . 除了其他人发布的内容之外,我还提到了合并复制,以及MSDN上有关选择适当复制类型的文章 Basically, whether you choose Merge or Transactional (with updating subscribers) depends on what the proportion of writes are at the different nodes, and the likelihood of conflicting changes. 基本上,无论选择合并还是事务(具有更新订阅者),都取决于写入在不同节点上的比例以及发生冲突更改的可能性。

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

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