Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up sync by keeping etag history #4936

Closed
icewind1991 opened this issue Sep 21, 2013 · 8 comments
Closed

Speed up sync by keeping etag history #4936

icewind1991 opened this issue Sep 21, 2013 · 8 comments

Comments

@icewind1991
Copy link
Contributor

icewind1991 commented Sep 21, 2013

As a way to speed up the sync client getting all the changes made on the server it might be an idea to keep the history of etags for the root folder of each user and the time that etag was generated.

With such a history in place the sync client could send a request to the server with it's own last known etag of the root folder which the server can use to easily get a list of all changed files and folder on the server since the last sync. If the server sends a fill of all changed files with their new etags and the new etags of all parent folders a download-only sync can be done with 0 propfinds, leaving only a single request overhead instead of having to run a propfind against all changed folders.

The query for listing all changes made only takes, after creating a new index, around 1 ms with 15000 files in the filecache in my test DB.

cc @dragotin @DeepDiver1975 @karlitschek @bartv2

@ghost ghost assigned icewind1991 Sep 21, 2013
@PVince81
Copy link
Contributor

So if I understand well each "revision" of that history is like a snapshot of the file list tree or its changes from the last one (not the file contents) ?
Interesting idea.

@icewind1991
Copy link
Contributor Author

My idea was to have a table of fileid, time and etag (which can be null for deleted files) and add a row every time a file changes.

Then if the client send the last root etag that it has locally the server has enough information to calculate all changed, new and deleted files since the last sync

@DeepDiver1975
Copy link
Member

This would allow us to perform change tracking and should deliver enough information to implement the webdav sync protocol https://tools.ietf.org/html/rfc6578

But this requires major rework on the client - no idea if we should walk this path.

@dragotin @danimo @MTRichards @karlitschek @craigpg

@PVince81
Copy link
Contributor

This logic looks similar to how the Dropbox API works, it also accepts a hash as input. But I believe it only does it for a single directory listing.

@karlitschek
Copy link
Contributor

Interesting idea. We should look into this in the long run to improve performance. Let's look into this for 8

@DeepDiver1975 DeepDiver1975 added this to the ownCloud 8 milestone Apr 29, 2014
@DeepDiver1975 DeepDiver1975 modified the milestones: 8.1-next, ownCloud 8 Jan 9, 2015
@DeepDiver1975
Copy link
Member

@dragotin @danimo something to think about these days?

@PVince81
Copy link
Contributor

PVince81 commented Oct 7, 2016

This sounds like the way how Webdav sync works.

@PVince81
Copy link
Contributor

If we have the change history in one place it could also be used as replacement for the activity table (or at least the file-based ones)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants