📜 ⬆️ ⬇️

Sync Files with SyncML

image Today, our company has released an update to the SynchroNet portal and another application for data synchronization in open beta testing. This time it is the file synchronization client for Windows. I would like to tell our users and just interested in the concept of how it works for us.

Introduction

Synchronization of files in SyncML is made in such a way that the transfer of large files using this protocol is not possible, in particular, due to the classical implementation of the SyncML API, which assumes that each SyncML package is downloaded into memory. In this regard, a solution is proposed that is based on the principle of podcasts, namely: applications exchange links, and the immediate receipt of the file is the responsibility of a particular application.

Implementation concept

The implementation of the file synchronization mechanism is based on the existing SyncML synchronization protocol with the addition of two new entities:

New file on device
A new file has appeared on the device, for which there is no link, synchronization is performed:
')
image
1. The application on the client opens the session and gets its ID. When opening a session, authorization is also performed. Also, when opening a session, the links with which the application is going to work within the session can be indicated, if these links are used by another application, an exception is thrown. For this use case no file list is specified.
2. File is being uploaded to the link manager.
3. For a new file, a link is obtained.
4. Session ends
5. The resulting link is used to generate xml for synchronization with the SyncML server.

New file on SyncML server
Some device added a file, but this file does not exist on the current device.
image
1.While synchronization, links are detected that are not on the device.
2. A session is opened; when opened, this file is indicated for blocking.
3. The file is loading
4. Session ends

Other
Of the main operations, only deletion and modification of files remained, the work on these scenarios is similar to the appearance of a new file on the device. The exception in case of deletion is that the file is not uploaded to the link manager.

Architecture

The main components involved in podcast synchronization are:

1. File sync connector in SyncML server
2. Manager of links


As for the connector, it synchronizes files in the same way as other objects in the synchronization. Files have the following properties:

1.Link
2.Date of creation / modification
3. Title

The link manager is a separate subsystem consisting of the following components:

1. Transaction Management Module
2. File manager
3. Authorization module
4. HTTP-based access protocol

image

Source: https://habr.com/ru/post/97878/


All Articles