[Owncloud] Syncing and Time Synchronization
Jono
jono at foodnotblogs.com
Thu Jul 19 19:47:40 UTC 2012
On Thu, Jul 19, 2012 at 7:49 AM, Evert Pot <evert at rooftopsolutions.nl> wrote:
> On Jul 19, 2012, at 1:09 PM, Jono wrote:
>> In the client and server database we maintain a sync-token for each
>> file. The token can just be a random generated value that will be
>> regenerated on the server every time the file is in a new state. When
>> the server and client tokens differ it means the version of the file
>> on the server is the latest. If the token on the server and client
>> match, the files match.
>
> exactly.
>
>>
>> We maintain timestamps in the client database. So when a file is
>> updated on the client side, we can check its timestamp against the
>> client database and see if it needs to be sent to the server.
>
> Yea a timestamp makes sense on the client, also an md5. But *only* to see if the local copy changed from a previous state.
>
>>
>> I know we are steering away from using timestamps over the network,
>> but is it ok to use it locally? I can see problems with this when the
>> user decides to change their system clock, but maybe that is a
>> different issue.
>
> I'd personally use timestamps and changes in filesize just as cheap way to figure out a file *may* have changed. If the timestamp is different (but not the size), I would still do md4/md5 checks to make sure there was an actual change.
Ok, lets say we no longer use timestamps to detect the need for an
update between the server and the client.
First we check to see if sizes differ. If the sizes do not differ we
use the md5 checksum to determine if there is a difference.
Now look at the method I describe above using tokens (not RFC6578).
So, instead of using checksums we use server generated tokens. Now
there is no checksum overhead. So why is a checksum needed? Is it
because WebDAV does not have a way to manage these types of tokens?
More information about the Owncloud
mailing list