Skip to content

feat(rivetkit): add experimental effect cluster support - #6023

Closed
NathanFlurry wants to merge 1 commit into
mainfrom
task-20261115-142645-7dc6d2e2
Closed

NathanFlurry wants to merge 1 commit into
mainfrom
task-20261115-142645-7dc6d2e2

Conversation

@NathanFlurry

@NathanFlurry NathanFlurry commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Experimental Effect Cluster support on Rivet Actors, as a new @rivetkit/effect-cluster package.

  • Provides Effect's Sharding, WorkflowEngine, and PersistedQueueFactory services on Rivet Actors; existing Effect Cluster code runs unchanged
  • Each entity instance is its own actor (named after the entity type, keyed by the entity id), with its mailbox and state in the actor's SQLite
  • Workflows run one actor per execution, persisted queues one actor per queue name, and singletons and ClusterCron on a singleton actor
  • DeliverAt and durable clocks use actor schedules, with a recurring heartbeat that replays missed work
  • ActorSqlClient gives each entity its own SQL database, committed in the same transaction as its mailbox
  • Compared with Effect's SQL backend: no hash ring or shard locks, no single Postgres bottleneck, horizontal scaling without rebalancing, no storage polling, idle entities sleep, and cheaper long-term storage
  • README covers the benefits, how it works (with diagrams), a comparison with the SQL backend, usage, and current limitations
  • Marked experimental; an ask longer than actionTimeout (default 15 minutes) fails, and PersistedQueue cleanup is not supported yet

Architecture

Each entity, workflow, queue, and singleton runs as its own Rivet Actor:

One Rivet Actor per entity

A persisted ask is one action through the gateway; the request and reply are stored in the actor's own SQLite:

A persisted ask on Rivet

Compared with Effect's SQL backend, which coordinates runners through a shared Postgres with a 300-shard hash ring and advisory locks:

Effect SQL backend on Postgres

The persisted ask on Postgres and on Rivet

@NathanFlurry
NathanFlurry force-pushed the task-20261115-142645-7dc6d2e2 branch from 6c43df2 to f23ddfc Compare November 22, 2026 03:14
@NathanFlurry

Copy link
Copy Markdown
Member Author

@NathanFlurry
NathanFlurry deleted the task-20261115-142645-7dc6d2e2 branch November 22, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant