2

According to the Zumero for SQL Server documentation the default conflict resolution behaviour is to use a record version number.

However, is it possible to base it on timestamps instead? The business rule is that the record that was last updated should win.

Also, is it possible (and simple enough) to sync down to each client device a specific subsection of the server-side database?

PS: The assumption would be that the client device's time is roughly in sync with the internet time - a check will periodically be performed on the device. Due to the nature of the data, it is not a problem if the client's clock is a few seconds out. In the exceptional case that updates happen within 5 seconds of each other, it really doesn't matter which one wins. The most important thing is that on average and across all clients, the last record wins.

Paul Roub
  • 36,322
  • 27
  • 84
  • 93

1 Answers1

1

Conflict Resolution by Timestamp

In short, no. It's not possible to choose a "winning" change by timestamp today. But you should question whether that's really what you want. :)

The Zumero for SQL Server docs are incomplete, but the conflict resolution details in the cloud server docs are still correct. (The way you set them changes, but the rules themselves are unchanged.) In short:

Records have version numbers. Unless two users modify the same version of the same record, the newest version is always accepted, which is the same behavior you'd get with timestamps (without the problems associated with inaccurate system clocks).

If two users modify the same version of a row, you have a conflict. The default conflict resolution is column merge:

  • Changes to different columns of the same record are all accepted.
  • For conflicting changes to the same column of the same record, the last to reach the server is accepted.

You can change conflict resolution such that the server accepts the latest version synced, without column merging, which may be what you want. From the server's perspective, this is the most recent record. You'd do this by changing the situation_mod_after_mod resolution to action_accept.

Dividing up the SQL Server Database

Version 1.0 (and the current preview release) allow chopping up the SQL Server database by table. Using the ZSS Manager app, you define a dbfile.

  • A dbfile is the smallest sync-able unit.
  • On a client, a dbfile becomes a sqlite database file.
  • On the server, you choose tables to add to a dbfile.
  • A SQL Server table may only belong to a single dbfile.

There are more details in the ZSS Manager documentation.

Ian Olsen
  • 153
  • 7
  • Is there any way to customize the behaviour to do a partial select from certain tables (typically based on relationships, e.g. user A is assigned to company X and to only data linked to company X should be synced to the local device). – user2935274 Oct 31 '13 at 05:05
  • Not in the current release. Segmentation is only by table, today. – Ian Olsen Nov 06 '13 at 14:49