Synchronization Flow
Synchronization is a complex mechanism in OpenNotas. It can be summarized briefly in the following diagram:
The actionObject
is an object that keeps track of all the actions leading to the synchronization process, such as adding a folder, renaming a folder, adding a note, editing, deleting a note, etc. In other words, it includes all the necessary actions for data synchronization.
Here is a simple example of the data synchronization process when adding a folder:
- The user creates a folder.
- An "add folder" event is added to the
actionObject
. - When the synchronization time comes, a synchronization process is initiated:
- First, pull the latest data from the server and store it in the local database.
- If there is a conflict between the server data and the client data, resolve the conflict by merging the two data sets together, while marking it in the
actionObject
. - Push the data sequentially to the sync server by reading the data in the order it appears in the
actionObject
.
- Finish one synchronization cycle.