A
A
Alexander2020-07-20 18:16:48
Algorithms
Alexander, 2020-07-20 18:16:48

How does synchronization work?

What can be read on the topic? What are the principles and best practices?

The application is extremely simple - clients can add items and change their states. It is necessary to ensure the synchronization of items from clients.

Actually a problem that clients should/can work without access to the Internet. After resuming access, you need to synchronize.

For now, the idea is to make a separate action table and enter any action on an item into this table as an action (especially since the history of changes must be stored) and exchange only actions. Each action will have a time of its creation, which means that they can be arranged in a consistent sequence and applied to each client (and on the server, of course) sequentially.

It is confusing that there are two sources of truth - the sequence of actions itself and the list (final state) of items. Also, let client A create action 100 and client B create action 97. The sequence of actions applied on client B will be "normal" - first 97, then 100 will be executed, and the sequence on client A will be abnormal - 100, then 97.
Assume both actions are connected with the status change, then client A and client Byitems will be in different status - you need a way to reorder actions...

It turns out that you need to exchange only actions, and the list is calculated as their resulting sequence, which can become a problem when there are a lot of actions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-07-20
@dmtrrr

https://en.wikipedia.org/wiki/Conflict-free_replic...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question