RFC: Real time updates granularity
We've settled on a method of communicating updates to fragments and collections, using server-sent events over a single 'channel' as described here: pubsweet-server!43 (merged), but what we're unsure is at what level and in what way the updates should be applied. The issue is mainly that large updates (updates of big fragments, simultaneous content and metadata updates) can lead to overwrites, conflicts, and the opposite is true for granular updates, which can be implemented in a few ways.
There are three options to discuss (using fragments as an example):
-
We communicate updates for entire fragments, but those fragments represent smaller chunks of the content
-
Fragment metadata and fragment content are stored in separate fragments, linked in a one-to-one relationship
-
Fragments are in a many-to-many relationships with other fragments
-
We implement updating as granularly as possible but keep single big fragments, i.e. update only a single property of a collection and fragment
Personally I'm leaning towards option number three, and this one is also the one that we're implementing initially, but I'd like to invite @alf, @blahah, the Editoria team (@yannisbarlas, @alexgeo and @christos), and others, to chime in with their thoughts on this.