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

前端 未结 8 1138
梦谈多话
梦谈多话 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:45

    Server-side push techniques are the way to go here. Comet is (or was?) a buzz word.

    The particular direction you take depends heavily on your server stack, and how flexible you/it is. If you can, I would take a look at socket.io, which provides a cross-browser implementation of websockets, which provide a very streamline way to have bidirectional communication with the server, allowing the server to push updates to the clients.

    In particular, see this demonstration by the library's author, which demonstrates almost exactly the situation you describe.

提交回复
热议问题