mamcx
mamcx

Reputation: 16186

How sync data to a SQL server in multi-tenant setup from local sqlite

I have a scenario where N clients connect to a central server (PostGres based). All of the N clients can get offline, and store everything in sqlite database. Is a service like fresh books, to make invoices.

Each client have a local copy of the main data (customers, products) filtered for that user. All client can update customers, products and each one work for their own invoices (i.e.: each client edit only his own invoices, but see aggregated data for everyone).

I know about add timestamp and GUID IDs, but not how approach this task. About how detect conflicts and auto-solve it, or if exist a sample code I can look about this..

P.D: Only sqlite is fixed. Because I'm in the planning stage, I could switch to any tech necessary that could solve better this task... I'm work with .net, python, django, obj-c

Upvotes: 1

Views: 1394

Answers (1)

JuneT
JuneT

Reputation: 7860

have a look at Sync Framework. although in your case, you may have to write a custom provider to work with the non-MS databases.

here's a sample using PostGres: InfoQ: Making Microsoft Sync Framework work with PostgreSql.

some links to Sync Framework to give you an idea how it works:

Synchronizing SQL Server and SQL Express

How to: Handle Data Conflicts and Errors for Database Synchronization (SQL Server)

Synchronizing Other ADO.NET Compatible Databases

Offline-Only Scenarios

How to: Use a Custom Change Tracking System

Upvotes: 1

Related Questions