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

Binary Protocols for disk storage and websocket #1585

Open
Quantumplation opened this issue Aug 22, 2024 · 2 comments
Open

Binary Protocols for disk storage and websocket #1585

Quantumplation opened this issue Aug 22, 2024 · 2 comments
Labels
💭 idea An idea or feature request

Comments

@Quantumplation
Copy link
Contributor

Why

Right now, the websocket protocol and file persistence use JSON; this is fine for most use cases, but one big bottleneck we noticed in the Hydra Doom project was that this quickly becomes a problem. In just a few days, the nodes had produced over 10 terabytes of on-disk state, and the added JSON overhead inflated our ~480 byte transactions to several kilobytes; at 200 transactions per second per node, that is a significant amount of overhead.

What

It would be nice/convenient to have binary protocols for both of these things for scenarios that need to squeeze that much more out of the performance of the hydra node.

How

I'm not sure how this interplays with the plans to potentially use something like a postgres backend for persistence, but the source/sink APIs we recently contributed would be well suited for providing alternative implementations of these protocols.

@Quantumplation Quantumplation added the 💭 idea An idea or feature request label Aug 22, 2024
@Quantumplation
Copy link
Contributor Author

(Perhaps this should have been a discussion before an issue, woops)

@ch1bo
Copy link
Collaborator

ch1bo commented Aug 26, 2024

@Quantumplation That's fine. Thanks for contributing this idea. The purpose is clear: "Reduce JSON overhead".

What we should do about it is a bit less so. I currently see at least one drawback: switching from human-readable form to a binary encoding has the drawback of being impossible to debug without additional tooling.

Maybe an alternative way to reach the same purpose (at least one step) would be to only store the event stream (state file) and have the API outputs be an interpretation/subset of those. We should track this in an alternative idea (with a similar purpose) though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💭 idea An idea or feature request
Projects
None yet
Development

No branches or pull requests

2 participants