{"by":"NathanFlurry","descendants":16,"id":47197003,"kids":[47198419,47198762,47198118,47205887,47198702,47198975,47198385,47259390,47218997,47198525,47205331],"score":45,"text":"Hey HN! We posted Rivet Actors here previously [1] as an open-source alternative to Cloudflare Durable Objects.<p>Today we&#x27;ve released SQLite storage for actors (Apache 2.0).<p>Every actor gets its own SQLite database. This means you can have millions of independent databases: one for each agent, tenant, user, or document.<p>Useful for:<p>- AI agents: per-agent DB for message history, state, embeddings<p>- Multi-tenant SaaS: real per-tenant isolation, no RLS hacks<p>- Collaborative documents: each document gets its own database with built-in multiplayer<p>- Per-user databases: isolated, scales horizontally, runs at the edge<p>The idea of splitting data per entity isn&#x27;t new: Cassandra and DynamoDB use partition keys to scale horizontally, but you&#x27;re stuck with rigid schemas (&quot;single-table design&quot; [3]), limited queries, and painful migrations. SQLite per entity gives you the same scalability without those tradeoffs [2].<p>How this compares:<p>- Cloudflare Durable Objects &amp; Agents: most similar to Rivet Actors with colocated SQLite and compute, but closed-source and vendor-locked<p>- Turso Cloud: Great platform, but closed-source + diff use case. Clients query over the network, so reads are slow or stale. Rivet&#x27;s single-writer actor model keeps reads local and fresh.<p>- D1, Turso (the DB), Litestream, rqlite, LiteFS: great tools for running a single SQLite database with replication. Rivet is for running lots of isolated databases.<p>Under the hood, SQLite runs in-process with each actor. A custom VFS persists writes to HA storage (FoundationDB or Postgres).<p>Rivet Actors also provide realtime (WebSockets), React integration (useActor), horizontal scalability, and actors that sleep when idle.<p>GitHub: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;rivet-dev&#x2F;rivet\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;rivet-dev&#x2F;rivet</a><p>Docs: <a href=\"https:&#x2F;&#x2F;www.rivet.dev&#x2F;docs&#x2F;actors&#x2F;sqlite&#x2F;\">https:&#x2F;&#x2F;www.rivet.dev&#x2F;docs&#x2F;actors&#x2F;sqlite&#x2F;</a><p>[1] <a href=\"https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42472519\">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42472519</a><p>[2] <a href=\"https:&#x2F;&#x2F;rivet.dev&#x2F;blog&#x2F;2025-02-16-sqlite-on-the-server-is-misunderstood&#x2F;\">https:&#x2F;&#x2F;rivet.dev&#x2F;blog&#x2F;2025-02-16-sqlite-on-the-server-is-mi...</a><p>[3] <a href=\"https:&#x2F;&#x2F;www.alexdebrie.com&#x2F;posts&#x2F;dynamodb-single-table&#x2F;\" rel=\"nofollow\">https:&#x2F;&#x2F;www.alexdebrie.com&#x2F;posts&#x2F;dynamodb-single-table&#x2F;</a>","time":1772295118,"title":"Show HN: SQLite for Rivet Actors – one database per agent, tenant, or document","type":"story","url":"https://github.com/rivet-dev/rivet"}