clockworklabs / clockworklabs/SpacetimeDB

Rate limit/throttle or debounce reducers

Open
#5,197 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

I'd like a server authoritative way to make sure my reducers aren't called a bazillion times. So this could mean a rate limiter or debounce, but either was as a macro would be nice.

  • A rate limiter that does some nice things like burst management or X requests per second X per minute
  • A debounce behavior like how web apps handle stuff, just accept the last request if they all burst in 10 within 100ms accept the last one. So at most X requests per Nms, without dropping requests. Slightly different than rate limit which complete blocks when reaching the limit.
  • Some combination of both?
  • Some other thing i'm unaware of?

ATM the only solution I can think of that we can do now is to implement a table to track last request and who made it, then comparing and returning error. Or we just simply rely on the client to be a good citizen and not hack to kill the server with requests.

Requested by @onx2 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

The issue names no files, tests, or entry points. Start by clarifying whether the intended behavior is rate limiting, debouncing, or both, including burst handling, request ordering, and scope. The work is done when the behavior and configuration are agreed and covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.