Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
348 views
in Technique[技术] by (71.8m points)

distributed - Sync nightmare - is it possible to use Merge Replication (or RDA) between 2 SQL CE instances without IIS?

We are faced with the following problem that involves keeping the following in sync:

  • 1 Centralised Server (IIS / MSSQL 2005)
  • Many Desktop WPF clients distributed by ClickOnce
  • Many Mobile clients - (Windows CE)

alt text http://img502.imageshack.us/img502/8246/deployment.png

With these thorny constraints:

  • all sync relationships are bi-directional
  • the desktop & mobile nodes require offline mode
  • the mobile nodes cannot sync with the central server but are to sync with the desktop nodes over USB. The desktop nodes act as a server for the mobile clients, not the central server. Updates from the mobile nodes then need to propagate to central server by virtue of syncing with the desktop, and then syncing that desktop with the central server. phew.

Nasty.

To sync the desktop and server we know we can use Merge Replication - the server being a provider, the desktop as a subscriber, all good. BUT what about syncing the mobile and desktop nodes? Seemingly the Desktop cannot be a publisher without SQL server + ISS, right? We can only deploy MSSQL CE to the desktop.

Even if this was the case, could a node be both subscriber and publisher? I suspect that this arrangement isn't supported by the Merge Replication architecture - seemingly hub and spoke is the only supported model.

We are trying to determine if we can eliminate RDA or Merge Replication as a possible solution - if so we will probably pursue the MS Sync Framework.

Perhaps there are other technologies that we could consider?

Thanks all,

Ashley

UPDATE: we've just started having a play with MS Sync Framework and it rocks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For reasons not directly related to your specific question, I think you can go ahead and eliminate RDA/Merge Replication as a possible solution. Microsoft does not advertise this (for obvious reasons), but merge replication is not 100% reliable under conditions where the network connection can be dropped in the middle of the replication process (which happens quite frequently with Windows Mobile clients).

The result of this problem is that changes made to client databases are sometimes not fully propagated to the master database, but you get no detectable indication that this has happened. As you can imagine, this is a bad thing, especially if you sold your client on this solution based on the assumption that RDA works as advertised. The only short-term solution we found to this problem was to implement a very clunky double redundancy process to confirm that each record added or modified on the client made it to the server without error. The long-term solution was to never again use RDA for anything.

This problem may have been fixed in recent versions of RDA (our problem occurred with the latest version 2 years ago), but I'll never know (once bitten twice shy).

Update: by the way, I've had many people I've spoken to about this (including Microsoft support techs) deny that this could possibly be true, but it's very easy to verify: add a bunch of data on the client, then start replication, then yank the USB cable out of the device (assuming your client is Windows Mobile connecting through ActiveSync) while in the middle of this.

If I seem slightly miffed, it's partially because this was what the MS tech was finally forced to say (actual quote): "well, just keep replicating - the data will merge eventually".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...