Skip to content

A brand new database synchronization, multi platform, multi databases, developed on top of .Net Standard 2.0

Notifications You must be signed in to change notification settings

julianariel/Dotmim.Sync

 
 

Repository files navigation

Warning : This is a work in progress !!!

If you want to contribute or test :

  • Code is a work in progress, no available Nuget packages at this time.
  • Code is a work in progress, I found bugs every days. No doubt you'll find a lot, too. Keep calm and open an issue :)
  • Code is a work in progress, if you want to test / code / you need to install Visual Studio 2017 Preview to be able to target .net standard 2.0.

Go download a free version here : Visual Studio 2017 Preview

TL;DR

DotMim.Sync is a straightforward SDK for syncing relational databases.
It's .Net Standard 2.0, available and ready for IOT, Xamarin, .NET, and so on :)

Multi Databases Cross Plaform .Net Standard 2.0

It's based on a master slaves architecture :

  • One provider, as the master, for the server side.
  • One or more provider(s) for the client(s) as slave(s).
  • One sync agent object SyncAgent to handle the sync process.

Here are the nuget packages :

TL;DR: I Want to test !

If you don't have any databases ready for testing, use this one : AdventureWorks lightweight script for SQL Server

The script is ready to execute in SQL Server. It contains :

  • A lightweight AdvenureWorks database, acting as the Server database (called AdventureWorks)
  • An empty database, acting as the Client database (called Client)

Here are the simplest steps to be able to make a simple sync :

// Sql Server provider, the master.
SqlSyncProvider serverProvider = new SqlSyncProvider(@"Data Source=(localdb)\MSSQLLocalDB; Initial Catalog=AdventureWorks;Integrated Security=true;");

// Sqlite Client provider for a Sql Server <=> Sqlite sync
SQLiteSyncProvider clientProvider = new SQLiteSyncProvider("advworks.db");

// Tables to be synced
var tables = new string[] {"ErrorLog", "ProductCategory",
    "ProductDescription", "ProductModel",
    "Product", "ProductModelProductDescription",
    "Address", "Customer", "CustomerAddress",
    "SalesOrderHeader", "SalesOrderDetail" };

// Agent
SyncAgent agent = new SyncAgent(clientProvider, serverProvider, tables);

do
{
    var s = await agent.SynchronizeAsync();
    Console.WriteLine($"Total Changes downloaded : {s.TotalChangesDownloaded}");

} while (Console.ReadKey().Key != ConsoleKey.Escape);

I want more !

All options and detailed can be found in the Wiki !

Seb

About

A brand new database synchronization, multi platform, multi databases, developed on top of .Net Standard 2.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%