A
A
Atmaks2018-08-30 06:19:31
Data synchronization
Atmaks, 2018-08-30 06:19:31

How to synchronize web application state?

I am developing a SPA on React, in which interaction with the server takes place via Websocket. To manage the state, react-redux is used, that is, the state can be expressed in JSON text of some size. Is there a general way to keep this state in sync between the server and clients (which are few) at an acceptable speed? Now, for each action, a message is sent to the server, which sends a new part of the state as a response. With this approach, it turns out that for each interaction I need to register:
1) the message to be sent;
2) message processing by the server;
3) response format;
4) response processing by the client side.
I would like to "stupidly" call "syncMyRide" instead. Is this even possible? Obvious problems are conversion to and from JSON and validation.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question