In this model, tables at each site contain both primary and replicated data. However, each site functions as a primary site for a particular subset of rows called a fragment. Updates to the primary fragment are distributed to other sites. Updates to nonprimary data are received from the primary sites of other fragments.
Applications that use the distributed primary fragments model have distributed tables that contain primary and replicated data. The Replication Server at each site distributes modifications made to local primary data to other sites and applies modifications received from other sites to the data that is replicated locally.
The following tasks must be performed at each site to replicate a table in the distributed primary fragments model:
Create the table in each database. The table should have the same structure in each database.
Create indexes and grant appropriate permissions on the tables.
Allow for replication on the tables using the sp_setreptable system procedure.
Create a replication definition for the table at each site.
At each site, create a subscription for the replication definition at the other sites. If n is the number of sites, create n-1 subscriptions.
Figure 3-3 diagrams the flow of data for distributed primary fragments:
Figure 3-3: Distributed primary fragments model
Figure 3-4 illustrates a salesdetail table set up with distributed primary fragments at three sites. Each site receives replicated data via two subscriptions.