Jan 16, 2012

Microsoft Azure SQL Data Sync

Azure Data Sync let’s you synchronize enterprise (on-premise) SQL Server (2005 and above) databases with SQL Azure databases – or several SQL Azure databases. There is a local agent and a cloud sync group service necessary for it to work.

This is the first preview from Nov 14 2011; let’s have a try.

In the management portal navigation tree go to Data Sync, select a subscription, a data center region,

image

You now have two options:

image

Let’s synchronize on-prem and a cloud SQL Azure database. The wizard leads you through the configuration of a sync group

image

image

image

image

Download and install the so called Sync Agent for the local server.

image

Then start the Data Sync Agent Preview from the start menu.

image

Now generate an agent key from the management portal and copy it into the local agent wizard.

image

Then register a SQL Server

image

to get

image

Back in the portal we add the agent to the Sync Group

image

Now we are half way through. Now let’s add an SQL Azure database:

image

Just creating a new SQL Azure database for this demo – and selecting it in Step 3 above.

image

In the following step (4) we configure the scheduling, and the conflict resolution (client or hub wins)

image

Select the on-premise SQL database

image

Click deploy now

image

Done!

Now, let’s see that it worked correctly. In the local Northwind database there are 2 people from Switzerland, add a row filter for Country = ‘Switzerland’. Then go the SSMS, connect the SQL Azure DB. There is a new dbo.Customers table now. Please also note the added tables for the change tracking. There are also some triggers and stored procedures added to your database. This may impact your runtime performance.

image

There are the 2 rows as expected:

image

That’s it again in the portal

image

This was actually super simple to setup. There are some best practices out there.

Negative point: there does not seem to exist an API or .NET library for scripted configuration and operation.

No comments:

Post a Comment