Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep stateful web clients in sync, when multiple clients are looking at the same data?

In a RIA web client, created with GWT, the state is maintained in the web client, while the server is (almost) stateless (this is the preferred technique to keep the site scalable).

However, if multiple users looking at the same data in their browser and one user changes something, which is send to the server and stored in the database, the other users still have the old data in their browser state. For example a tree is shown and one of the users adds/removes an item from the tree.

Since there can be a lot of state in the client, what is the best technique to keep the state in the clients in sync? Are there any java frameworks that take care of this?

like image 528
Hilbrand Bouwkamp Avatar asked May 19 '10 08:05

Hilbrand Bouwkamp


1 Answers

Push changes (delta) only, it applicable, and if not -- re-sync client completely. That's what we do with our remote clients (not only GWT but with Eclipse RCP too). We send delta contexts while changes are small and local, and on global change we re-sync. This will require to design a sophisticated diff protocol, and often will require redesign of remote client protocol from scratch.

like image 180
Slava Nadvorny Avatar answered Oct 22 '22 06:10

Slava Nadvorny