lundi 6 mars 2017

How to make multiple users edit a text at the same time without losing data?

Let's say we have an web application that allows multiple users to write in a text field. For instance: let's say that we have user1 and user2 using the application simultaneously.

  1. At the beginning the text field is empty.
  2. User1 writes "Hello world" and clicks the send button.
  3. After that, both user1 and user2 see the "Hello world" on the text field.
  4. User2 erases the "world" word and writes "galaxy" then sends the message.
  5. Now both user1 and user2 see "Hello galaxy".
  6. And so on......

But there are cases that data will be lost, principally when both users are editing the text field at the same time. How can I do to fix this problem? Is there a way? If not, what is the best way to do something like that? Thank you guys!




Aucun commentaire:

Enregistrer un commentaire