One of the core strengths of the Meteor platform are its optimistic updates, that favor a local state vs. a server-side state to achieve much more responsive web UIs, at the cost of potential temporary glitches (a server rejecting an update).
In industrial applications, like control systems that operate machinery in factories, a similar pattern is used to change remote state, called “objective state”. In this pattern a client sends a target
state to a server, while a server sends an actual
state back to the client. The actual
state should eventually converge to the provided target
state.
Often a server also sends a target
state to the client, representing the target the server is currently converging to, which is useful when there are multiple clients.
An example of this pattern can be found in https://www.corto.io (a data-backend for industrial systems) by using target
datatypes (disclaimer: I am a developer for corto):
struct Thermostat::
temperature: target{int32}
In code:
// Updates 'target when run on client, 'actual' when run on server
corto_int32Update(myThermostat->temperature, 65);
The objective state pattern prevents the temporary glitches (important in industrial systems), while still being able to leverage local (fast) updates. It’s advantages however diminish when the convergence between client & server is very fast.
I’m intrigued by Meteor’s optimistic UI as clearly a lot of thought went into it and seems to work generally well. Though I am curious whether the objective state pattern could have an application in web apps as well. For example:
- For high-latency connections (bad cellular network)
- Show more info in a UI about the progress of the server converging
- Improve UX by preventing “jumping back in time” if the server rejects updates
- …
Any thoughts?