-
Notifications
You must be signed in to change notification settings - Fork 88
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
Constant memory API server history using StateEvents #1618
Labels
💬 feature
A feature on our roadmap
Comments
Related ADR which also proposes to implement projections on top of the main event stream:https://hydra.family/head-protocol/adr/25 |
Merged
4 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Feb 6, 2025
Changes I made originally for the `hydra-doom` project to load all events in `state` (12GB+ in that use case) with constant memory using `conduit` streams. ~~There is a big TODO on this: `IOSim s` does not have a `MonadUnliftIO` instance and its not impossible to have one. We need to change the interface further such that we can compose `createHydraNode` and `hydrate` functions with in-memory `EventSource` variants.~~ ~~A bit of a wart: The `mkProjection` does run the conduit for each projection, instead we should run the conduit once and build the projected in-memory read/query model once.~~ Also, the change here is not constant-memory as the `ServerOutput` history is still kept fully in memory. But this is a different story and should be covered by #1618 --- * [x] CHANGELOG updated or not needed * [x] Documentation updated or not needed * [x] Haddocks updated or not needed * [x] No new TODOs introduced or explained herafter
Not fully done yet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why
While working on the hydra-doom project, we noticed that the in memory state grew without bound (see #1572). This meant that, at the sustained load that the hydra doom demo was producing, nodes became inoperable after just a few hours.
One of the culprits was the
?history
of thehydra-node
websocket API. That feature sends clients the whole history by default (can be turned off, see documentation https://hydra.family/head-protocol/docs/api-behavior#replay-of-past-server-outputs)We want to make Hydra heads be operable for long times even with sustained load, which requires us to bound any memory usage (and even disk usage, see #1581).
What
Greetings
message.?history=true
, is loaded on-demand from disk.How
hydra-node
such that theAPIServer
is an interpreter ofStateEvent
stream #1717Projection
read models need to aggregate overStateEvent
eventId
asseq
uence number?history
EventSink
The text was updated successfully, but these errors were encountered: