SQL Azure Data Sync enables creating and scheduling regular synchronizations between SQL Azure and either SQL Server or other SQL Azure databases. It is a cloud-based data synchronization service built on the Microsoft Sync Framework technologies. It provides bi-directional data synchronization and data management capabilities allowing data to be easily shared across SQL Azure databases within multiple data centers. The current release is Community Technical Preview 2 (CTP2).
For a Proof of Concept I want to synchronize a subset of my on premise database to a SQL Azure database. In this blogpost I will explain what need to be done to synchronize on premise data to a SQL Azure database.
- You must have a Windows Live ID
- You must have a SQL Azure account
- SQL 2005 SP2 or later.
- Request a registration code for SQL Azure Data Sync CTP. This can be requested here. After registration you can start using SQL Azure Data Sync
- On premise SQL database.
The synchronization of data is handled by the SQL Azure Data Sync Agent. In the SQL Azure Data Sync UI you can define the agent.
The UI of this services can be started via Start, All Programs, Microsoft SQL Azure Data Sync, Microsoft SQL Azure Data Sync.
To configure the agent, press the Edit Agent Key and paste the agent key which is generated when you created the agent in the SQL Azure Data Sync UI
Use the Add Member button to add your on premise database to the agent.
Use the Ping Sync Service to test the agent.
In the SQL Azure Data Sync UI in the Tab Databases, you will see your on premise database. Press the add button to add your SQL Azure database.
- Press the New Sync Group button to add a Sync Group.
- Add your on premise database and SQL Azure database to the Sync Group.
- Press the next button and select the tables you want to synchronize. Some tables are not possible to select because:
- They do not have primary keys defined.
- They have clustered indexes defined on non-primary key columns.
- Enable the Sync Group and configure the synchronization schedule.
What is not possible in CTP2:
- Changes in data model are not supported. For instance in my on premise database we create a new column to a table which is synchronized. This new column can't be added to the synchronization.
- Changes to a Sync group can't be made. If you want to add an additional table to the synchronization, you can't add it to the existing synchronization group.
- Synchronize tables for which the clustered index is not the primary key. In a lot of situations the primary key will differ from the clustered index. This is because of performance reasons.
My first impression of the SQL Azure Data Sync is good. Big progress is made. It is easy to setup. To use it in a commercial product I think that the 3 things I mentioned are essential for a commercial solution.