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?

1 Answers1

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
  • 337