clockworklabs / clockworklabs/SpacetimeDB
Reimplement: Add Zstd compression to the websocket messages
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
This issue tracks reimplementation of the work from stale PR #2846, which is being closed because it is too out of date to merge directly.
Original PR: https://github.com/clockworklabs/SpacetimeDB/pull/2846
Original author: @ResuBaka
Original branch: `zstd-websocket-compression`
Base branch: `master`
## Original PR summary
# Description of Changes
This add the option to the websocket/subscribe endpoint so you can use Zstd as the compression in addition to None/Brotli/Gzip.
API and ABI breaking changes
None
Expected complexity level and risk
1
Testing
- I have tested it with the simple chat example where I have enabled the zstd compression and added some logging to see if it was used
- Testing for the compression speed to find the best level
Additional
What we could look into is to use zstd dictionary features to improve the performance even more as it could possible help with the base structure of each message. The only thing that would then needed to be done is have an extra option in the enum as an ZstdDict as the client and server would need to know about the dictionary.
## Follow-up
- Reimplement this change in a fresh PR against current `master`.
- Carry forward any still-relevant context from the original PR discussion and review.
- Link the new implementation PR back to the original stale PR for historical context.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current websocket/subscribe endpoint and the changes in stale PR #2846 against the current master branch. Reimplement the Zstd option alongside None, Brotli, and Gzip, then verify it with the simple chat example and link the fresh PR to the original for context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, networking
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100