Skip to main content

Cassandra scale, without running Cassandra.

Rivet splits data by key like Cassandra, but each key gets its own SQLite database, with real transactions, easy schema changes and S3 as its only dependency.

Choose Rivet for

  • Yes: High-throughput, high-volume writes
  • Yes: Per-user, per-chat and per-agent data
  • Yes: Transactions across every table for a key
  • Yes: Schema changes shipped like code
  • Yes: S3 as the only dependency

Choose Cassandra for

  • Yes: Workloads already running on Cassandra
  • Yes: One giant append-heavy table read by key and time, like event logs

Each Rivet Actor is a partition, so the partition key becomes the Actor key.

Move one table family off Cassandra

Paste the prompt into your coding agent to port one table family, or follow the quickstart.

Read the quickstart

Why agent data outgrows Cassandra

Agents write a lot of data: each concurrent agent keeps about 4 GB a month, and Apache Cassandra stores all of it on every replica.1

  • No: Partitions should stay under 100 MB and 100K values1A busy agent passes 100 MB in a day, so transcripts get split into time bucketsYes: One database per agent, with no size capRead a whole transcript in one query
  • No: Large blobs in cells are an anti-patternFiles go to S3, outside any transaction with the transcriptYes: An agent’s files live in its own databasePi Durable and agentOS can keep them in SQLite
  • No: Every replica keeps a full copy on disk2With 3 on SSD, the bill grows $985 every month for 1K concurrent agentsYes: Recent data on SSD, older data on S3~10x cheaper for older data
  • No: A new node streams its share of data to joinThen you run cleanup on the nodes it took ranges fromYes: Nodes running Actors hold no dataNew nodes take traffic right away

Six months of storage for 1K concurrent agents12

Cassandra

$20,684

Rivet

$1,982

Total spent on storage over 6 months.

$0$3K$6KToday3 months6 months$5,910/mo$566/mo

Why transactions are hard on Cassandra

Cassandra is atomic and isolated only inside one partition. A Rivet transaction covers every table in an Actor, and one Actor holds everything for its key.

  • No: Atomic and isolated only within one partitionOne chat’s data sits in different partitions, one per query tableYes: Transactions across every table in an ActorRelated rows commit together
  • No: Batches across partitions apply eventually, without isolationReaders can see a batch half appliedYes: Isolated, all-or-nothing commitsOther queries wait until it commits
  • No: Lightweight transactions are compare-and-set on one partition34 replica round trips per write, or 2 on Paxos v2Yes: One Actor owns each key’s writesNo compare-and-set needed
  • No: Last write wins by timestampConcurrent updates overwrite each other silentlyYes: Writes apply in orderThe Actor runs them one at a time
  • No: Cross-partition transactions aren’t released yet4Accord is in the Cassandra 6.0 alpha, and off by defaultYes: Steps across Actors run as durable WorkflowsTransactions stop at the Actor; Workflows retry and resume

Why Cassandra schemas are hard to change

Cassandra tables are shaped around their queries, so a new query or key usually means a new table. On Rivet, a schema change is code each Actor runs as it starts.

  • No: The primary key can never changeRe-keying or re-bucketing means building a new tableYes: Change any table in a migrationPlain SQL or Drizzle, in onMigrate
  • No: A new query pattern often needs a new table5Dual writes, a backfill and a cutoverYes: A new query is a new indexOne CREATE INDEX in onMigrate
  • No: A backfill rewrites every row on the live clusterIf it fails, the new table is left half filledYes: Each Actor migrates itself as it startsAtomic: a failed migration rolls back

List a chat’s messages by sender

Cassandra splits each chat’s messages into time buckets, so the query-first answer is a new table keyed by chat and sender. On Rivet it’s one index.

Cassandra: new table, dual writes, backfill

-- 1. A new table keyed by the new query
CREATE TABLE messages_by_sender (
  channel_id uuid,
  sender_id uuid,
  sent_at timeuuid,
  body text,
  PRIMARY KEY ((channel_id, sender_id), sent_at)
) WITH CLUSTERING ORDER BY (sent_at DESC);

-- 2. The app writes every message twice
BEGIN BATCH
  INSERT INTO messages (...) VALUES (...);
  INSERT INTO messages_by_sender (...) VALUES (...);
APPLY BATCH;

-- 3. A job backfills every old message,
--    then reads cut over to the new table

Rivet: one index in onMigrate

db: db({
  onMigrate: async (db) => {
    // Runs in each Actor as it starts
    await db.execute(`
      CREATE INDEX IF NOT EXISTS messages_by_sender
      ON messages (sender_id, sent_at)
    `);
  },
}),

// Query it like any other table
await c.db.execute(
  `SELECT * FROM messages WHERE sender_id = ?
   ORDER BY sent_at DESC`,
  senderId,
);

Why Cassandra is heavy to run

Self-hosted, Cassandra is a cluster of JVM nodes that keep your data on their disks. Rivet is one binary, and S3 is its only dependency.

  • No: A cluster of nodes sized to hold all your dataAdd disks and nodes as data growsYes: S3 is the only dependencyDisks hold recent writes; the durable copy is in S3
  • No: Repair, compaction, tombstones and JVM tuningRepair must run within gc_grace_seconds, or deleted data can come backYes: Written in Rust for performanceOne binary, with no JVM, repair or compaction to tune
  • No: Snapshots are hard links on each nodeYou copy them off every node yourselfYes: The durable copy already lives in S3Offloaded from disk in the background

Rivet vs Cassandra

FeatureCassandraRivet
Query languagePartly: CQLSQL-like, one table per query, no joinsYes: Full SQLSQLite, per Actor
JSONPartly: JSON in and outNo queries inside documentsYes: JSON functionsQuery and index inside documents
Full-text searchPartly: Whole-value matchesSAI doesn’t tokenize; SASI is experimentalYes: FTS5Full-text indexes in SQLite
GeospatialNo: Not built inNo geo types in open-source CassandraYes: R*TreeSpatial indexes in SQLite
OperationsPartly: Repair, compaction, JVMA cluster of nodes that hold your dataYes: One binaryS3 is the only dependency
Horizontal scalingSame on bothSplit data by key, add nodes
Proven enginesSame on bothSQLite and Cassandra both run in production at huge scale
Open sourceSame on bothApache 2.0; SQLite is public domain
Managed cloudSame on bothRivet Cloud, or Astra DB and Amazon Keyspaces
Self-hostingSame on bothYour cloud, on-prem or air-gapped

How we estimated

Measured on a real agent, then scaled to 1,000 concurrent agents. Cassandra is self-hosted on Amazon EBS gp3 in us-east-1 with 3 replicas, at list prices.

  1. 1An active agent

    We ran a real Pi Durable coding agent in a Rivet Actor: 15 sessions across five coding tasks, 28 minutes of non-stop work, with 267 model calls and 231 tool calls.

    While working it wrote about 6 rows a second at about 480 bytes each: about 11 MB an hour. About 5.7 MB an hour stays in its database, 75 to 80% of it the transcript.

    A concurrent agent is one agent working all the time: 5.7 MB × 24 hours × 30 days ≈ 4.1 GB kept a month. 1,000 concurrent agents keep about 4.1 TB a month.

    Cassandra’s docs advise under 100,000 values and 100 MB per partition, and split bigger ones by adding a bucket, such as a month, to the partition key. At 5.7 MB an hour, one agent passes 100 MB after about 17.5 hours of work.

  2. 2Storage cost

    Cassandra: EBS gp3 costs $0.08 per GB-month in us-east-1 (AWS price list, effective 2026-11-01). With 3 replicas, each GB of data costs $0.24 a month. Amazon Keyspaces charges about the same, $0.25 per GB-month, with three copies included.

    This is Cassandra’s best case: no free space left for compaction, no extra IOPS or throughput, no instances. We count the same data size on both; Cassandra’s per-cell metadata and its default compression pull in opposite directions.

    Each month 1,000 concurrent agents add 4,104 GB × $0.24 ≈ $985 to the bill. After six months that’s 24.6 TB, or $5,910 a month.

    The chart compares that with S3 for data Rivet has moved there; recent data stays on replicated SSD. S3 Standard is $0.023 per GB-month for the first 50 TB (51,200 GB), so six months in it’s 24,624 GB × $0.023 ≈ $566 a month.

    Over six months: Cassandra adds up to $985 × (1 + 2 + … + 6) ≈ $20,684. S3 adds up to $94 × 21 ≈ $1,982.

  3. 3Lightweight transactions

    Lightweight transactions run on Paxos, which supports a single key, so each one covers one partition.

    cassandra.yaml expects 4 round trips for a write and 3 for a read on the default Paxos v1, and 2 for a write on the recommended v2.

  4. 4Accord

    Accord brings cross-partition transactions in Cassandra 6.0. The latest 6.0 build is 6.0-alpha2; the latest GA release is 5.0.9.

    Accord starts only when accord.enabled is set to true in cassandra.yaml, and each existing table then migrates to it, with repairs, before it runs on Accord.

  5. 5Schema changes

    onMigrate runs every time an Actor starts, before any other hook, inside a SQLite savepoint. If it throws, everything it ran rolls back before the Actor starts. A sleeping Actor migrates when it next wakes.

    It times out after 30 seconds by default, and one transaction can change up to 128 MiB of pages, so an index on a very large table can exceed it.

    On Cassandra, SAI indexes can serve some new lookups without a new table, but a query that doesn’t name the partition key reads from across the cluster, and the primary key still can’t change.

Sources, read November 17, 2026

Keep the scale. Drop the cluster.

A SQLite database per Actor, with real transactions and S3 as the only dependency.

Read the quickstartTalk to an engineer