How does Windows Live Mesh sync files between computers?

6

Computer A and Computer B are both syncing a given folder. You add a 2GB file to the folder on Computer A, naturally it gets pushed over the wire to Computer B, albeit slowly. If you then make changes to the 2GB file on computer A, what happens?

I figure the choices are really

a) it pushes the entire 2GB file to Computer B or b) it analyzes the differences between the two files, and sends only the changes over the wire. Computer B's mesh service then applies those changes.

But which is it?

Also, what happens if I move that 2GB file to a subfolder?

Ken Pespisa

Posted 2011-05-28T00:05:46.367

Reputation: 569

Answers

5

If you then make changes to the 2GB file on computer A, what happens?

There are several ways of detecting the change.

  1. You could hash the file and see if the hash differs (costly). This is the method many MMO patchers use for file integrity checks, etc.

  2. The filesystem maintains a last modified field. So indexing the file by modification date is relatively cost effective. Then you simply have to poll the directory regularly and update things as needed.

  3. Many operating systems actually allow you to subscribe to a list of files/folders and be notified of when they change, new files are added, etc.

Then we need to send only the changes. Many protocols and algorithms support only sending the changes. Rsync is a well used protocol (and probably similar to what mesh does) that only translates the difference between machines with compression, so it is fairly bandwidth efficient. The issue with huge files is that one change may cause a huge chain of small changes that is fairly hard to diff efficiently.

I am pretty sure that mesh uses both differential and compression when transmitting between machines. But it is a closed source product and I couldn't find anything confirming that.

Also, what happens if I move that 2GB file to a subfolder?

In most cases you will need to re download the changes. For all intents and purposes the program will see that as a delete and then a new file being added in the new location.

Theoretically you could hash all the files and look to see if the new addition is already stored by comparing the hashes. This would be fairly costly (for instance if you are adding 1,000 small files).

Matt

Posted 2011-05-28T00:05:46.367

Reputation: 329

5Wonderfully written. However, I think the question was more about what does the Windows Live Mesh product do. – Chris_K – 2011-05-28T01:05:12.883

1I did some testing and you're right on both counts. Based on how quickly Mesh returned to "Up To Date" status, there is definitely some kind of differential sent between machines and not the entire file. Also, when moving files I confirmed that the originals were deleted and new files added to the new folder. – Ken Pespisa – 2011-05-28T13:10:23.583

1One other fun fact. I moved around 150+ 100MB files from Computer A into a new folder, and after doing so noticed Mesh was slowly chugging through the list on Computer B, re-downloading them as if they were new (after having deleted the files from the original folder). I saved a lot of extra bandwidth drain by moving those files out of the recycle bin on Computer B and into the correct folder. Mesh intelligently detected the change, scanned the folder again, and then showed it as Up-To-Date. – Ken Pespisa – 2011-05-30T00:28:02.377