Database Reference
In-Depth Information
changes are proliferated to all the other databases in the current data center as well as other databases in
other data centers that you've defined in your configuration to be part of your synchronization.
The SQL Azure Data Sync Service is part of Windows Azure and runs in Windows Azure, so it can
take advantage of the web and worker roles. A key component of the SQL Azure Data Sync Service is its
use of the Microsoft Sync Framework, a synchronization platform provided in the .NET Framework. The
great thing is that all this synchronization functionality is provided for you, hosted in the South Central
US data center; there is no application you need to run or installation you need to perform.
The Basic Scenario
Every SQL Azure synchronization environment includes a single database hub and has one or more
database members , as shown in Figure 11-1. Setting up synchronization includes creating and defining a
synchronization group in which you specify the hub database and then assign the database members to
that hub.
Figure 11-1. Data Sync Service architecture
Let's talk about the initial synchronization for a minute, because it's helpful to understand the
process and changes that take place. When the initial sync takes place, it's a two-step process:
1.
The hub database schema is copied to the member database(s).
The data is copied from the hub database to the member database(s).
This may seem simple, but let's discuss what happens during these two steps. First, you don't have
to generate the target (member) database schemas yourself. During the first step, the Data Sync Service
does that for you (for the tables you specify to sync). As part of this process, foreign key constraints are
not copied. This is because a full schema synchronization capability hasn't been built into the Data Sync
Service as of yet.
Because foreign keys aren't copied, you may be wondering what happens in the scenario where data
is entered at the member that could potentially break synchronization back to the hub. The answer is
that you can control the order in which data is applied, and this helps make certain the changes that are
applied don't affect any foreign key constraints. During the initial sync, changes are made to both the
hub and member databases to effectively track data changes. You see this behavior in the example later
in this chapter.
The next step in the process is the data synchronization that takes place after all the member
databases are provisioned. Provisioning of the members takes place during the initial sync. Data
2.
 
Search WWH ::




Custom Search