Document toolboxDocument toolbox

FileSync

The Microbizz file sync functionality provides a way of synchronizing the file on a remote drive with Microbizz.

Files and folders in Microbizz are copied to the remote drive, and files and folders from the remote drive are copied to Microbizz. The whole procedure is complicated by the way Microbizz stores files and folders - these are not stored in a directory structure, but are database objects, and so it is not possible to use standard/commercial file synchronization software.

The file sync is handled by the classes FileSync and FIleSync2.

Version 1

Version 1 of the file sync uses FTP or SFTP to read a list of files/folders from the remote drive and compare it with the list of files/folders in Microbizz. This can be very time consuming, as it is necessary to send a FTP command for every folder and subfolder in order to do a complete sync of the remote drive, even if no files have changed on the drive.

The file sync doesn't require anything special from the remote drive, except FTP or SFTP support.

Version 2

Version 2 requires a "client" to be installed on the remote drive PC. The client is a Windows program, written in node.js. The client continuously monitors which files are modified or created or deleted on the drive; this list is then transmitted to Microbizz.

The protocol is defined here: FileSync2 protocol

Microbizz Drive

Microbizz Drive uses the same protocol as version 2 (with a few minor additions), and uses a client written in C++ for additional speed and stability.

Proxy

The file sync supports a proxy functionality, which is intended to reduce the amount of data stored in Microbizz. If f.ex. the remote drive holds a very large number of large files, that are only occasionally viewed in Microbizz, then there is no need to transfer all this to Microbizz, instead only the "meta" data is transferred during the synchronization, and the actual file data is only downloaded from the remote drive to Microbizz when someone actually tries to access the file in Microbizz.

The proxy is combined with a cache, so that the downloaded files may be removed after a while.

Both ways (no data in MB)

This is like the proxy mode, but no data is stored in Microbizz, except for the cache. If a file is added from Microbizz, the binary data may be removed from MB after the file has been synchronized.