如何使用Microsoft Sync Framework(v2 CTP 2)对客户端敏感数据进行分区?

时间:2009-08-26 06:30:21

标签: distributed microsoft-sync-framework database-partitioning

我们的中央数据库将在集线器中同步。说话时尚。

我们需要能够以客户端数据仅在本地复制到该客户端的方式对数据进行分区。

有人遇到过这个问题吗?

MSF提供同步作用域 - 表的声明将被合成,并且可以选择指定filtercolumn和filter子句,但是似乎没有办法将参数(比如clientID)传递给过滤器。 / p>

以下是msdn文档中的示例:

        ' Create a scope named "filtered_customer", and add two tables to the scope. 
        ' GetDescriptionForTable gets the schema of each table, so that tracking 
        ' tables and triggers can be created for that table. 
        Dim scopeDesc As New DbSyncScopeDescription("filtered_customer")

        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Customer", serverConn))
        scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("CustomerContact", serverConn))

        ' Create a provisioning object for "filtered_customer" and specify that 
        ' base tables should not be created (They already exist in SyncSamplesDb_SqlPeer1). 
        Dim serverConfig As New SqlSyncScopeProvisioning(scopeDesc)
        serverConfig.CreateTableDefault = DbSyncCreationOption.Skip

        ' Specify which column(s) in the Customer table to use for filtering data, 
        ' and the filtering clause to use against the tracking table. 
        ' "[side]" is an alias for the tracking table. 
        serverConfig("Customer").AddFilterColumn("CustomerType")
        serverConfig("Customer").FilterClause = "[side].[CustomerType] = 'Retail'"

        ' Configure the scope and change tracking infrastructure. 
        serverConfig.Apply(serverConn)

我们的问题是我们需要过滤除了clientID作为运行时参数。

MSF是否支持此功能?

如果不是,这可以通过声明多个范围来实现 - 使用filterclause为每个客户端声明一个范围,指定clientID。这将要求每次我们创建新客户端时重新配置服务器....对吗?

是否有人知道SqlSyncScopeProvisioning类是否可用于将新范围添加到已使用现有范围配置的数据库中?

似乎MSF旨在支持多个范围,我不清楚如何使用SqlSyncScopeProvisioning类添加其他范围。

0 个答案:

没有答案
相关问题