Open rjcorwin opened 3 years ago
re: Implement Case Documents as a log of Actions - would this be an immutable log, like a couchdb or (gasp) blockchain?
(gasp) blockchain
Lol, well for starters in order for a Tablet to write to the log that would require all tablets to be connected to the Internet in order for a network of miners to process Proof of Work or Proof of Stake so that's probably not going to work for most scenarios.
How about a checkpoint id or version id for each commit of this log? Or would this simply adding Couchdb on top of Couchdb?
Sounds like what you are proposing is we put the logs for a Case in the Case's own Document. I think that's one way, another is that each log is its own Document. The latter has the advantage that for each change to a Case, everyone only needs to download the data for that one change, meanwhile if each change for Case was in the Case doc itself, you would be downloading the record of all changes every time there is one change. So, "One Doc Per Change in a Case" vs. "All Changes for a Case in one Doc". The first downside I can think of for "One Doc Per Change in a Case" is that CouchDB would now no longer flag when there is a conflict, that is if the State of a Case is the sum of Log Docs. Tablets would never be writing to the same doc so CouchDB would never catch a conflict. However a trick might be is that when writing a Log Doc you also write some minimal data to the Canonical Case Doc, like toggle a boolean flag on it, then you would generate a revision on a common doc and CouchDB would be able to catch that as a conflict.
diff
instead ofgit
that stores the history. Insted use MergeConflictType(s) that are algorithms that check divergent trees for merge conflicts.