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
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
精彩评论