pod icon indicating copy to clipboard operation
pod copied to clipboard

Enable efficient fetching of latest version of the document

Open lucasvo opened this issue 5 years ago • 0 comments

Given the following scenario:

Doc1:
Node A: v0 | v1 | v2 | v3
Node B: v0 |    |    | ?

When B requests the latest versions (only from a version onwards) from A, A:

  • Gather all versions that B has access to, with all data within. As this will be needed as well by the signature state consensus issue.
  • Send them to B

Then B:

  • Stores versions
  • For latest one, add entry to new table document_latest that points to latest document version
  • In case that B has missing access to a version of the document, then fill with headers-only and overridable block version. (debatable if needed)

Changes:

  • New p2p endpoint that returns all versions that a collaborator has access to, given a start version:
{
    DocIdentifier: docID,
    FromNonce: fromNonce,
}
  • Add Simple Index table to find latest document versions.
    • Every new document update need to update the latest version value
  • Remove logic to iterate over versions (search) to find the latest on GetLatestDocumentVersion, just access the latest document table

lucasvo avatar Apr 17 '19 10:04 lucasvo