clockworklabs / clockworklabs/SpacetimeDB

Module-level subscriptions

Open
#2,445 3 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

Hello,

First of, amazing job with this database. The level of dedication and commitment to innovating tech definitively shows a lot of progress! I can see the potential for SpacetimeDB not only for gaming, but for more general purpose business application, with the exception of the current client permission scheme. While RLS is a good step, what if you allow modules to subscribe users to queries rather than just relying on the client side to manage it? Most business application require stricter rule around data management that would better fit on the server side. Combining module-based subscription and allowing an option to disallow client subscriptions means you could choose to control the subscriptions exclusively on the server side via reducers.

I wanted to give a good gaming example where this change can grant better flexibility with data; Lets say we have a table for player's inventory and players should only see their own inventory. This can be implemented with RLS, however if the developer wants to integrate pickpocketing players via a special skill or item, RLS would block any way for the client to get temporary visibility to another player's inventory.

I started looking through the code to see how viable this is, however I have no experience with Rust, yet I'd love to help where I can with this.

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 or tests. Start by tracing the existing RLS and client subscription handling, then examine how reducers could control subscriptions. Done would mean a defined server-side module subscription model that can optionally prevent client-managed subscriptions, with the permission behavior covering the inventory and temporary-visibility cases described.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
authorization, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.