frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: SQLite for Rivet Actors – one database per agent, tenant, or document

https://github.com/rivet-dev/rivet
29•NathanFlurry•3h ago
Hey HN! We posted Rivet Actors here previously [1] as an open-source alternative to Cloudflare Durable Objects.

Today we've released SQLite storage for actors (Apache 2.0).

Every actor gets its own SQLite database. This means you can have millions of independent databases: one for each agent, tenant, user, or document.

Useful for:

- AI agents: per-agent DB for message history, state, embeddings

- Multi-tenant SaaS: real per-tenant isolation, no RLS hacks

- Collaborative documents: each document gets its own database with built-in multiplayer

- Per-user databases: isolated, scales horizontally, runs at the edge

The idea of splitting data per entity isn't new: Cassandra and DynamoDB use partition keys to scale horizontally, but you're stuck with rigid schemas ("single-table design" [3]), limited queries, and painful migrations. SQLite per entity gives you the same scalability without those tradeoffs [2].

How this compares:

- Cloudflare Durable Objects & Agents: most similar to Rivet Actors with colocated SQLite and compute, but closed-source and vendor-locked

- Turso Cloud: Great platform, but closed-source + diff use case. Clients query over the network, so reads are slow or stale. Rivet's single-writer actor model keeps reads local and fresh.

- 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.

Under the hood, SQLite runs in-process with each actor. A custom VFS persists writes to HA storage (FoundationDB or Postgres).

Rivet Actors also provide realtime (WebSockets), React integration (useActor), horizontal scalability, and actors that sleep when idle.

GitHub: https://github.com/rivet-dev/rivet

Docs: https://www.rivet.dev/docs/actors/sqlite/

[1] https://news.ycombinator.com/item?id=42472519

[2] https://rivet.dev/blog/2025-02-16-sqlite-on-the-server-is-mi...

[3] https://www.alexdebrie.com/posts/dynamodb-single-table/

Comments

swaminarayan•2h ago
“sqlite per actor” feels like very clean actor level isolation. the part I am more curious about is how you recommend handling cross actor queries.
NathanFlurry•1h ago
We built everything with this architecture internally already at Rivet. It's less common than you might expect to have to query cross-DB in practice.

However, we are planning on building a query engine that can operate over multiple databases. One option we're considering is exposing Rivet SQLite as a DuckDB datasource: https://duckdb.org/docs/stable/data/data_sources

nudpiedo•1h ago
I get where you come from, but really needs it to be a whole SQLite instance per database? Wouldn’t be more efficient just logic separation in a larger DB?

Better usage of resources and it always allows a parent style agent do complex queries (e.g: intersection of two different actors data doesn’t need to fetch all, copy and do it in buggy non sql code)

NathanFlurry•1h ago
Hey! This is a common question.

In our experience, most apps don't need cross-tenant queries outside of BI. For example, think about the apps you use on a daily basis: Linear, Slack, ChatGPT all fit well with an actor-per-workspace or actor-per-thread model.

To be clear, we're not trying to replace Postgres. We're focused on modern workloads like AI, realtime, and SaaS apps where per-tenant & per-agent databases are a natural fit.

Using SQLite for your per-tenant or per-agent databases has a lot of benefits:

- Compute + state: running the SQLite database embedded in the actor has performance benefits

- Security: solutions like RLS are a security nightmare, much easier to have peace of mind with full DB isolation per tenant

- Per-tenant isolation: important for SaaS platforms, better for security & performance

- Noisy neighbors: limits the blast radius of a noisy neighbor or bad query to a single tenant's database

- Enables different schemas for every tenant

- AI-generated backends: modern use cases often require AI-generated apps to have their own custom databases; this model makes that easy

A few other points of reference in the space:

- Cloudflare Durable Objects & Agents are built on this model, and much of Cloudflare's internal architecture is built on DO

- https://neon.com/use-cases/database-per-tenant

- https://turso.tech/multi-tenancy

- https://www.thenile.dev/

- Val.town & Replit

> Better usage of resources

I'd be curious to hear more about what you mean by this.

> always allows a parent style agent do complex queries

Do you have a specific use case in mind where agents need to query other agents' data?

fastball•1h ago
We recently replaced an isolated feature built on Durable Objects with Rivet Actors, to allow for much better interop with the rest of our infra (which is built on AWS/Vercel), and are happy with it so far.

There have been some small issues but nothing show-stopping, and the Rivet team has been very responsive to help get things sorted (or help us understand when it was us doing something wrong).

Not using the SQLite datastore yet, but I am excited about the possibilities!

NathanFlurry•1h ago
Cheers!
ZeroAurora•1h ago
I love the idea of DOs and I'm happy to see an OSS implementation.

Would it be interesting to write about comparisons against Cloudflare Durable Object to the project README? Both for clarity and marketing reasons.

NathanFlurry•41m ago
Thanks! Any questions in particular on the comparison?
siliconc0w•1h ago
Really interesting to see these new compute paradigms. I haven't built anything on Durable Objects yet but I can see the appeal and I'd prefer an OSS option.

SqliteDB per tenant may make sense, not sure about per actor. You really don't want to re-implement database transactions.

NathanFlurry•31m ago
Cheers!
malkosta•41m ago
It’s crazy how pretty much every tool people post to support AI systems is already in Erlang/OTP or in elixir standard libraries.
NathanFlurry•31m ago
Yep, everyone seems to reinventing the actor model from first principles right now.

We're taking a different approach of building the best actor primitive for mainstream languages and letting people build a thin AI layer on top. We did not set out out build for AI when we started it, it was a happy accident.

Show HN: Now I Get It – Translate scientific papers into interactive webpages

https://nowigetit.us
115•jbdamask•6h ago•75 comments

Show HN: Tomoshibi – A writing app where your words fade by firelight

https://tomoshibi.in-hakumei.com/
14•hakumei•2h ago•8 comments

Show HN: SplatHash – A lightweight alternative to BlurHash and ThumbHash

https://github.com/junevm/splathash
47•unsorted2270•8h ago•19 comments

Show HN: Gitcredits – movie-style end credits for any Git repo in your terminal

https://github.com/Higangssh/gitcredits
26•swq115•7h ago•2 comments

Show HN: AIQuotaBar – See Claude/ChatGPT usage limits in your macOS menu bar

https://github.com/yagcioglutoprak/AIQuotaBar
2•toprak123•1h ago•1 comments

Show HN: GitShow Repo Showroom – a landing page for any GitHub repo

2•ofershap•1h ago•1 comments

Show HN: SQLite for Rivet Actors – one database per agent, tenant, or document

https://github.com/rivet-dev/rivet
29•NathanFlurry•3h ago•12 comments

Show HN: Nugx.org – A Fresh Nuget Experience

https://nugx.org
3•plsft•2h ago•2 comments

Show HN: Mowgli – Figma for the agent era, with Claude Code and design export

https://mowgli.ai/
5•thegeomaster•2h ago•0 comments

Show HN: Decided to play god this morning, so I built an agent civilisation

https://github.com/nocodemf/werld
34•urav•5h ago•27 comments

Show HN: Unfucked - version all changes (by any tool) - local-first/source avail

https://www.unfudged.io/
119•cyrusradfar•1d ago•79 comments

Show HN: Claude-File-Recovery, recover files from your ~/.claude sessions

https://github.com/hjtenklooster/claude-file-recovery
93•rikk3rt•1d ago•38 comments

Show HN: Reclaim Flowers – A 2D physics-based "Digital Altar" protocol

https://github.com/voice-of-japan/Virtual-Protest-Protocol/blob/main/README.md
9•sakanakana00•6h ago•2 comments

Show HN: Stacked Game of Life

https://stacked-game-of-life.koenvangilst.nl/
2•vnglst•3h ago•0 comments

Show HN: RetroTick – Run classic Windows EXEs in the browser

https://retrotick.com/
187•lqs_•1d ago•56 comments

Show HN: Book Corners – A map to discover and share free little libraries nearby

https://www.bookcorners.org
3•andreagrandi•3h ago•0 comments

Show HN: Soma, a local-first AI OS with 178 cognitive modules and P2P learning

https://github.com/unimaginative-artist/SOMA
2•Undeca•4h ago•0 comments

Show HN: I ported Manim to TypeScript (run 3b1B math animations in the browser)

https://github.com/maloyan/manim-web
135•maloyan•3d ago•24 comments

Show HN: I built a self-hosted course platform in Clojure

https://clojure.stream
53•jacekschae•2d ago•10 comments

Show HN: Badge that shows how well your codebase fits in an LLM's context window

https://github.com/qwibitai/nanoclaw/tree/main/repo-tokens
83•jimminyx•1d ago•40 comments

Show HN: Pkgdex – Search 3.5M Linux/Unix packages across 67 distros

https://pkgdex.org/
2•dvershinin•5h ago•2 comments

Show HN: BitTorrent client written in Go without external dependencies

https://github.com/vedantdaterao/torgo
6•zxcvbnm322•5h ago•0 comments

Show HN: EEGFrontier – A compact open-source EEG board using ADS1299

https://github.com/TheusHen/EEGFrontier
4•TheusHen•8h ago•0 comments

Show HN: I built a dashboard to track AI's impact on jobs

https://www.clocktick.ai/
2•AznHisoka•5h ago•0 comments

Show HN: MontaukOS – A hobbyist OS in C++ with a GUI, networking, and DOOM

https://github.com/danihamm/MontaukOS
4•danihamm•5h ago•1 comments

Show HN: RTS with known stars and exoplanets can now be played in the browser

https://stardustexile.com
4•apseren•6h ago•0 comments

Show HN: MemoryKit – Persistent memory layer for AI agents

https://github.com/0j/memorykit
3•memorykit•6h ago•0 comments

Show HN: CarbonLint – Open-source real-time energy&carbon profiler for software

https://nishal21.github.io/CarbonLint/
3•nishalk•6h ago•0 comments

Show HN: Psmux – tmux compatible multiplexer for Windows

4•uniquegodwin•6h ago•1 comments

Show HN: Hacker Smacker – Spot great (and terrible) HN commenters at a glance

https://hackersmacker.org
142•conesus•4d ago•166 comments