Skip to content
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

Allow schema evolution with memory #2

Open
maparent opened this issue Aug 28, 2023 · 0 comments
Open

Allow schema evolution with memory #2

maparent opened this issue Aug 28, 2023 · 0 comments

Comments

@maparent
Copy link
Member

maparent commented Aug 28, 2023

Remember each HK schema by its SHA. (Eventually connect with IPFS, but out of this scope.)
The server has a global state, where each prefix is linked both with a URL and (optionally, independently) a HK schema at any given time. Allow time travel. This defines a "context", which can be expressed as a simplified json-ld context. Extend this json-ld context to have the signature of the prefix' schema. (Use "prefix@sha" namespace for this...)
The events will use this time travel to refer to the context at the time of their creation. Optionally, incoming events could refer to the context's timestamp to ensure that they are using up-to-date definitions.
This means that there can be only one HK context definition per prefix at any time; eventually allow context merging to maintain this invariant.
(Note: Projections always use the current schema. Not sure I want to allow projection time travel, except maybe in snapshots.)
All this should eventually allow handlers to work on earlier event definitions safely.

Note: This is completely in flux. I am now thinking of schema definition element events on the event stream, with the issue that the event inheritance semantics is really undefined. (I should disable event inheritance for some event types?) The schemas elements become immutable, and the events could keep pointing to those by immutable identity. The range should still be a name (Term or UUID) that is bound to a schema element at time $t$ for a given source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

1 participant