clockworklabs / clockworklabs/SpacetimeDB

Bandwidth Optimisations

Open
#5,248 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.