tsync is a file server designed to minimize data transfer.

To achieve this goal, the client provides the server with information about the file it currently has. The server then uses this information to generate a diff. Finally, the client reconstructs the file on server using the diff. Since only a diff is transferred instead of the whole file, it’s much more efficient than a plain download.

The figure below shows data transferred when the file on server has a one-byte change:

• When the client doesn’t have the original file:

File    TX(%)   RX(%)   Total(%)
1K      4.98    100.98  105.96
4K      1.25    100.24  101.49
16K     0.32    100.06  100.38
64K     0.08    100.02  100.09
256K    0.02    100.00  100.02
1M      0.00    100.00  100.01
4M      0.00    100.00  100.00
16M     0.00    100.00  100.00
64M     0.00    100.00  100.00
256M    0.00    100.00  100.00
1G      0.00    100.00  100.00
4G      0.00    100.00  100.00
8G      0.00    100.00  100.00

• When the client has the original file:

File    TX(%)   RX(%)   Total(%)
1K      8.89    100.98  109.86
4K      2.22    100.24  102.47
16K     1.29    25.23   26.52
64K     1.06    6.47    7.53
256K    1.00    1.78    2.78
1M      0.98    0.61    1.59
4M      0.98    0.32    1.30
16M     0.98    0.24    1.22
64M     0.98    0.23    1.20
256M    0.98    0.22    1.20
1G      0.98    0.22    1.20
4G      0.98    0.22    1.20
8G      0.98    0.22    1.20


These results are obtained with a 4K chunk size. These results show that when the file size is over 1M, tsync only needs to transfer about 1-2% of the file size if the client has the original copy. Also, tsync incurs negligible overhead if the client doesn’t have a copy.