kvsync
v1.0.23
Published
Synchronization between two abstract key-value storages
Downloads
29
Readme
Algorithm
1. Acquire locks
Get lock files from both source and target storages and ensure that the objects either do not exist or exist but have passed expiration period. If both lock objects meet that conditions - new lock objects are put to the storage with appropriate metadata, including expiration.
2. Commit changes
Writing changes passed as the input to source index.
3. Pull indices
Reading index files from both source and target storages. Process is optimized to read as less data as possible. Only indices which represent the delta between source and target are pulled - process stops as soon as the first common change is found in both storages.
4. Calculate delta
Using change log obtained from index files, determine the list of changes which are missing in the opposite storage (exist in source but missing in target, exist in target but missing in storage).
5. Commit deltas
Writing index files with the changes from the opposite storage which are missing in the current one (from source to target and from tarted to source).
6. Push deltas
Applying change log which represents delta between source and target to both storages.
7. Release locks
Delete lock files created at the beginning of the process. Occurs also in case of an error.