Introduction
While working on a production ERP, I experienced issues with file synchronization. Instead of storing files in cloud services, we preferred to store them on our own servers. However, this led to some problems with file synchronization. To address these issues, we decided to use Syncthing. Syncthing is a tool that provides cloudless synchronization. In this article, I will discuss the advantages and disadvantages of using Syncthing, as well as what can be done regarding conflicts and versions.
Advantages of Syncthing
Syncthing has several advantages when it comes to file synchronization. Firstly, it is not dependent on cloud services; your data is stored only on your devices, and there is no central server. This provides more control over file storage and synchronization. Additionally, Syncthing's source code is open, and it is licensed under the Mozilla Public License 2.0 (MPLv2), making it verifiable and reliable for developers.
Disadvantages of Syncthing
Syncthing also has some disadvantages. The initial setup and configuration, especially regarding network settings, can be somewhat complicated at first. Moreover, for Syncthing to synchronize files between devices, these devices need to be on the same local network or an internet-connected network. If devices are on different networks, direct connection may require port forwarding or the use of relay servers, which can result in lower performance.
Conflicts and Versions
Syncthing supports file versioning. This feature allows tracking the history of changes made to a file and can store older versions in a .stversions folder using strategies like "Simple File Versioning."
In the event of a conflict, Syncthing does not automatically resolve it; instead, it preserves both conflicting files. When a file is modified simultaneously on multiple devices and the contents differ, Syncthing recognizes the conflict and renames one of the files to filename.sync-conflict-<date>-<time>-<changingDeviceID>.<extension>. Typically, the file with the older modification time is marked as the conflict and renamed. This allows the user to have both versions and manually decide which one is the "best" version.
syncthing --version
The above command will display Syncthing's version.
Settings and Configuration
When you start Syncthing for the first time, it automatically generates a device ID and a default configuration file. Syncthing does not use a central account system; devices recognize and pair with each other through unique device IDs.
syncthing generate
The above command generates a default configuration file (config.xml) and cryptographic keys for Syncthing. Warning: If Syncthing is already running or there is an existing configuration file, this command will create a new one and overwrite the existing file. To update or change an existing configuration, it's usually preferable to use Syncthing's web-based graphical user interface (GUI) or edit the config.xml file directly.
Conclusion
Syncthing is a cloudless, open-source, and secure file synchronization tool. It has advantages and disadvantages. It supports file versioning and manages conflicts by creating sync-conflict files, allowing the user to manually resolve them. To use Syncthing, there's no need to create a central account; instead, device IDs are used for pairing, and the configuration file is automatically generated on the first run or can be manually generated with the syncthing generate command. The next step is to start using Syncthing and synchronize files by pairing devices and configuring folders.
Top comments (0)