Microsoft Sync Framework - 本地数据库和远程数据库必须具有相同的架构吗?
当使用MSF时,技术中是否暗示同步表应该是1-1?
我想知道的原因是,如果我从 SQL2005 数据库同步到 SQLCE,我可能希望 CE 数据库更加扁平化,这样我就可以使用更简单的 SELECT 语句获取数据(因为 CE 不支持存储过程)。
例如,我可能在中央数据库中有 tblCustomer、tblOrder 和 tblCustomerOrder,但在本地数据库中可能首选包含所有数据的一张表。当然,我仍然希望更新能够在两个数据库之间来回反映。 MSF 是否使这成为可能,或者本地数据库是否必须具有与中央数据库相同的表?
When using MSF, is it implied in the technology that the sync tables are supposed to be 1-1?
The reason I'm wondering is that if I'm synching from a SQL2005 database to a SQLCE, I might want the CE one to be a little more flattened out so I can get data out with a simpler SELECT statement (as CE does not support sprocs).
For example, I might have a tblCustomer, tblOrder, and tblCustomerOrder in the central database, but in the local databases one table with all the data might be preferred. Of course I'd still want the updates to reflect back and forth between the two databases. Does MSF make this possible, or does the local DB have to have the same tables as the central?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Microsoft Sync Framework 2.0 中,数据库同步提供程序有两种范例。这些通常在文档中称为离线(中心和辐射)和协作(点对点)场景 - 每个场景都有自己的一组同步提供程序。模式需要有多相似取决于哪种场景以及您正在使用的提供程序。
离线场景结合了 ADO.Net 风格的适配器,具有很大的灵活性。
协作场景不要求字段数量相同,但所包含的字段双方必须具有相同的名称。此外,过滤器中使用的任何字段都必须作为列存在于两侧。
With Microsoft Sync Framework 2.0 there are two paradigms for the database sync providers. These are generally referred to in the documentation as Offline (Hub and Spoke) and Collaboration (Peer to Peer) scenarios - each comes with its own set of sync providers. How similar the schemata need to be depends on which scenario and by extension which providers you are using.
The Offline Scenario incorporates ADO.Net style adapters which allow a great deal of flexibility.
The Collaboration Scenario does not require the same number of fields but any that are included must have the same name on both sides. Further, any fields used in filters must exist as columns on both sides.
正如 Scott Munro 已经说过的,虽然您可以对数据进行切片和切块,但重要的字段必须位于两侧......根据数据的大小,您可能想要做的是在数据上使用触发器服务器端构建更平坦的表,然后同步......
AS Scott Munro has already said, while you can slice and dice the data, the important fields have to be there on both sides.... Depending on the size of your data, what you might want to do is use a trigger on the server side to build the flatter table and then sync that...