-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Explore alternative record architecture without "key indexes" #60
Comments
Other considerations and potential patterns to explore:
|
Another nod towards "shadowing the link data in the entry fields"- valueflows/vf-apps#5 (comment) For constraints like "if the event action is not defined as input and/or output, it should not be related to a process", not including the link field data in the entry actually makes validation logic far more difficult. We also need to ensure support for calling in to bridged DNAs during validation calls in order to fulfill constraints like the above. (CC @pdaoust) |
Further reflections to be had RE https://infocentral.org/drafts/PrinciplesDraft.html |
Closing this one as superceded- given the newer approach of keeping indexes separately to CRUD entries, not to mention the new Holochain architecture of using headers for updates & deletes. It does seem we are on the final pass of indexing cleanup and with #84 (comment) and #264 being addressed we should be in a good place for an MVP. |
When I ran through the first pass of inter-DNA linking, we were storing "base" entries (*) as the address of the first version of an entry to keep consistent IDs. This was mostly to allow for consistent record IDs between entry updates, across networks. After implementing the second pass, which does not use "base" entries as targets but instead writes metadata around the target link as a JSON-based entry, storage of such consistent record hashes seems less necessary.
(*)(which have since been renamed to "key indexes"; please substitute as appropriate when you see the older terminology)
It may be possible to link directly between entries whilst always referring to them by their consistent initial hash without incurring any additional storage overhead. For example, we would no longer need the consistently-identified
EVENT_BASE_ENTRY_TYPE
linking to the underlyingEVENT_ENTRY_TYPE
that has a roaming hash.create_record
, instead of storing the base entry address, just return the initial hash coming fromcommit_entry
.update_record
there would no longer be any need to dereference the entry; however, reading the entry metadata in order to determine the most recent version hash may be necessary. The initial hash (rather than most recent entry hash) would be returned from this method as an identifier for the record that remains consistent between updates.update_record
should accept a revision ID (read: actual entry hash) rather than a record ID (read: hash of first entry); which would necessitate returning this record metadata in responses (see Retrieve full revision history in all record responses #40). This method would also be better for avoiding undesirable update conflicts.delete_record
may have the same revision ID / record ID concern as for update, with the addition that there is no longer any base entry to delete.read_record_entry
takes the record ID initially returned fromcommit_entry
and follows the update metadata through to the latest version of the entry automatically- there is no longer any reason to dereference the base entry. We may optionally wish to validate that no previous versions of the provided entry address exist, to ensure that revision IDs cannot be incorrectly used as record locators.Aside from restructuring the zome
link!
definitions to remove the indirection, I don't think anything needs to change in the linking API. Provided all links continue to use the initial version of an entry, they should all still be readable in a single query for field traversals. It'll just be different link type names.The text was updated successfully, but these errors were encountered: