How to design a multi-user ajax web application to be concurrently safe

前端 未结 8 1141
梦谈多话
梦谈多话 2021-01-29 16:59

I have a web page that shows a large amount of data from the server. The communication is done via ajax.

Every time the user interacts and changes this data (Say user A

8条回答
  •  [愿得一人]
    2021-01-29 17:30

    I would consider adding time-based modified stamp for each dataset. So, if you're updating db tables, you would change the modified timestamp accordingly. Using AJAX, you can compare the client's modified timestamp with the data source's timestamp - if the user is ever behind, update the display. Similar to how this site checks a question periodically to see if anyone else has answered while you're typing an answer.

提交回复
热议问题