commontoolsinc / synopsys

datastore service for datums
2 stars 1 forks source link

Example with different kinds of arriving at current values and referring to them #50

Open seefeldb opened 2 weeks ago

seefeldb commented 2 weeks ago

Example: 1) User starts a "turn a photo of my bookshelf into a list of books" charm 2) User takes the photo and add that to the list of photos in the charm 3) This gets turned a list of books and rendered as charm 4) The charm also organizes the books into topics (this is a multi-step process) 5) User selects the "climate change" topic and casts a "compare view points" spell 6) A new charm that analyzes the books and shows where they agree and disagree is created 7) User buys new books, so adds a new photo to the bookshelf charm 8) This in turn updates the compare view points charm

Roughly, we have two kinds of nodes, and we need both: 1) Event handlers (/reducers?) that incorporate new information. When we see multiple concurrent writes we need to apply some kind of CRDT-like resolution. Steps 1, 2, 5, 7 are examples of this. 2) Derive nodes that compute output values dependent on input values. When we see multiple concurrent writes, the current value should come from the node working with the newest inputs and all others should be ignored. Note that if one machine is very slow, it might send writes for a computation based on old data after the faster machine already computed based on the newest inputs. We want to ignore that later write (and eventually the slower machine catches up, but that last write is idempotent). Steps 3, 4, 6 and 8 are examples.

A few complications to consider: