learn
packages/

Redis

Redis live room state, pub/sub, rate limiting, and write-behind queue integration.

Redis is the live authority and Postgres the durable one. Snapshot writes are atomic with a Lua version check; when a write lands, the room joins the dirty set and a coalesced flush job is scheduled — debounced, with a maximum wait, and forced when the last participant leaves. Rate budgets are per connection for ephemeral frames and stricter for commits.

What it owns

  • Live room snapshots with atomic revision-checked writes
  • The dirty-room set and the debounced flush queue
  • The room event bus for cross-server fan-out
  • Participant lists with join, renew, and leave
  • Per-bucket message rate limits

Files

File list and purposes from the folder README.

FilePurpose
src/index.tsRoom state, pub/sub, queue, and rate-limit operations.

Dependencies

LibraryVersion rangeWhy it is used here
BullMQ6.3.12Durable flush queue between Redis and the worker.
ioredis6.0.0Redis client behind live snapshots and pub/sub.
Development and tooling (3)
LibraryVersion rangeWhy it is used here
@types/node26.4.1Type declarations for Node.js built-ins.
tsx^4.23.13Runs and watches TypeScript sources for development and tests.
TypeScript7.0.2Compiles the workspace and type-checks every package.

Dependencies as of commit b0026d9.

Internal packages used

redis package
BrowserAPIRealtimeCacheDatabaseShareddurableephemeral

Talks to

Sources: packages/redis/README.md, packages/redis/src/README.md, packages/redis/src/index.ts (documented at commit b0026d9)

On this page