Project Description
A console application that does a synchronization between a database on-premise and Windows Azure SQL Database. This application uses the excellent and very efficient Microsoft
Sync Framework.
Synchronization Configuration
The synchronization is detailed in the configuration file, so it's really easy to setup, change, and update with out re-compiling. In the configuration file you will define:
- Local Database connection string
- Azure Database connection string
- The Scope name
- All the tables that must be include in the sync separated by a comma
- Number of retention days that the metadata should by kept
Here a sample of a configuration file
<configuration>
<connectionStrings>
<add name="LocalConnectionString" connectionString="Data Source=localhost\sqlexpress;Initial Catalog=MyLocalDatabase;Integrated Security=True"/>
<add name="CloudConnectionString" connectionString="Server=tcp:aaaaaaaa.database.windows.net,1433;Database=MyDatabaseName;User ID=MyAdmin@aaaaaaaa;Password=MyPassword;Trusted_Connection=False;Encrypt=True;"/>
</connectionStrings>
<appSettings>
<add key="SyncScopeName" value="Test"/>
<add key="TablesToSync" value="Table1,Table2"/>
<add key="DaysOfRetention" value="30"/>
</appSettings>
</configuration>
Using the application
The application may be called by passing different parameter :
- setup: Used only once and creates the tables and tools on both databases. The main database is SQL Server.
- reset: Resets the Meta data for the current scope.
- clean: It Deletes the Meta data for the current scope older than the "DaysOfRetention" contained in the configuration file.
- delete: It Deletes ALL related tables in Sync Framework.
- sync: It Performs bidirectional synchronization.
Simple call
Note :
If no parameter is passed then sync as the default synchronization is taking place.