clockworklabs / clockworklabs/SpacetimeDB
Bandwidth Optimisations
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
currently the bandwidth is one of the more expensive costs of stdb.
part of that is that deleted rows are send as full row even if the PK alone would be enough for the client.
for high update rate tables, this means it is sending almost double the data than it should be.
for row updates, it wouldn't even need the delete row at all as the client can just check if it has the pk in local cache and generate the update callback with just the new insert row.
so in short:
- deleted rows with PK could just be the PK
- updated rows with PK could just be the new insert row and no deleted row.
- rows without PK would still need to be send in full
but still this would likely cut down the bandwidth by close to 50% with just that small change.
Requested by @xDovos via the SpacetimeDB site.
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 tracing how row inserts, updates, and deletes are serialized and delivered to clients, focusing on the handling of primary-key and keyless rows. Verify that keyed deletes send only the primary key, keyed updates send only the new row, and keyless-row behavior remains unchanged while checking the resulting bandwidth and client callbacks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100