中央データベースは、ハブ & スポーク方式で同期されます。
クライアント データがそのクライアントにのみローカルにレプリケートされるように、データを分割できる必要があります。
誰もこの問題に直面しましたか?
MSF は同期スコープを提供します - テーブルの宣言は、filtercolumn とフィルター句を指定するオプションを使用して同期されますが、パラメーター (clientID など) をフィルターに渡す方法はないようです。
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 でサポートされていますか?
そうでない場合は、複数のスコープを宣言することでこれを実現できます。clientID を指定する filterclause を使用して、クライアントごとにスコープを宣言します。これには、新しいクライアントを作成するたびにサーバーを再プロビジョニングする必要があります....そうですか?
SqlSyncScopeProvisioning クラスを使用して、既存のスコープで既にプロビジョニングされているデータベースに新しいスコープを追加できるかどうかは誰にもわかりませんか?
MSF は複数のスコープをサポートするように設計されているようですが、SqlSyncScopeProvisioning クラスを使用してスコープを追加する方法がよくわかりません。