J
J
J. Snow2020-06-15 13:19:17
Web development
J. Snow, 2020-06-15 13:19:17

How to make co-editing data on the site?

Hi all!

There is a multi-user site written in React + backend + MySQL.
For simplicity, let this be a trivial TODO-app .

Users can simultaneously edit data:
add and delete TODO; edit title/description and other fields.

Task: Come up with the logic of work.

What difficulties I see:
- The user can lose the Internet at any time. I do not want to immediately disable the ability to edit. I would like to give the opportunity to work offline, and synchronize data when connected.
- When you reconnect, you must send all changes to the server. But what about the conflicting changes that happened before the internet existed? I mean that 2 users edited the same TODO offline, and then connected and need to synchronize the changes.
“There is also the problem of arranging changes in chronological order. After all, they need to go in chronological order. Accordingly, they must have some kind of timestamp. But the wrong date may be set on the client. In fact, it can change at any moment. You can do some kind of synchronization with the server, but there are also many difficulties.
“After all, there is the problem of merging data from multiple TODOs. First of all, we are talking, of course, about text fields. For example, if 2 users are editing the title at the same time.
- And all this needs to be stored in the database. And what about the situation when some older changes have reached the server than those that are already saved in the database?

In general, it would be desirable to learn who as solved similar problems?
Maybe there are some ready-made solutions for the described tasks?


Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Robur, 2020-06-15
@Robur

I had a slightly different task, but very close, which I eventually abandoned, but in the process of studying how to solve this, I learned about https://en.wikipedia.org/wiki/Conflict-free_replic...
Such structures allow you to change the common data independently and in parallel and then combine them into a result.
Perhaps this will point you in the right direction of thought.

M
maaGames, 2020-06-15
@maaGames

VCS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question