-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incremental Updates - UIS data store sync #3207
Milestone
Comments
Is this fixed by #3202? |
No, that was just incremental update of the data store inside the WFS, not incremental updates from WFS to UIS. |
This was referenced Sep 23, 2019
Changes to proposed scheme:
(Yes workflow delta is just PbWorkflow message)
(WS end implemented in #3389 so far) |
9 tasks
Closing dual PRs merged. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For communicating Workflow Service (WS) changes:
To kick the discussion off..: Based on the work done by @oliver-sanders, the graphql-protobuf PR, and the incremental data-store generation PR (pending merge), the following details one method/strategy to sync/mirror the WS data-store...
Scheme Proposal
The idea would be for each dynamic data element, that is a data element type containing fields that are updated and/or populated post-creation (i.e. task/family cycle instance), to contain a timestamped id.. These are already in place as
stamp
field, for example:(edges have static fields, but are added and removed dynamically)
These
stamp
IDs would be collated in lists according to type, this would form a sort of skeleton of the data-store and would be constructed at each end (WS and UIS):(Definition data elements are static content only changed on run/restart/reload)
An update message would contain two lists for the corresponding type. One containing all the stamp IDs for that type and the other being all updated/new data elements:
These update messages could be communicated using the PUB/SUB pattern (although there are others), and this pattern could be used for other purposes such as updates to a text interface via GraphQL..
On receipt, as a subscriber, the UIS would:
Now we could just hash the list of stamp to a single string and compare this, however sending the complete list has utility in the deletion and request of missing...
Example:
Take capitalised as the elements and lower as the
stamp
strings then:So the
SyncMsg
, who's elements[B, E, F]
could be populated with just the updated fields, is published/pushed to the UIS, then theUISData
elements are updated/populated and newstamps
generated from these:(As you may have noticed, the
UISData
missed an update message with elementD
. This is intentional, and it's purpose is to show how the scheme will handle this.)Now with the
stamps
from the updatedUISData
andSyncMsg
we can:SyncMsg
difference[b2, c1, d1, e1, f1] - [a2, b2, c1, e1, f1] = [a2]
to delete the corresponding elements (that are no longer in the WS data store).UISData
difference[a2, b2, c1, e1, f1] - [b2, c1, d1, e1, f1] = [d1]
to request any missing elements (i.e. if an update message is missed).(In set operations that would be
foo.difference(bar)
andbar.difference(foo)
)After deletions and requests are complete, generate the
stamps
again.(hence why the full list of stamps are sent with an update, the other option would be to periodically request/publish the entire skeleton)
The text was updated successfully, but these errors were encountered: