---
title: "2 million databases and counting: the architecture behind Sauna's AI teammate"
description: "Sauna, a proactive AI work assistant, gives every session, agent and connected inbox or calendar its own Turso database, creating about 90,000 databases a day and over 2 million in total."
url: "https://swe.quest/articles/2-million-databases-and-counting-the-architecture-behind-sauna-s-ai-teammate-ca635665d8781bf3"
canonical: "https://turso.tech/blog/2-million-databases-and-counting-the-architecture-behind-saunas-ai-teammate"
source: "Turso"
published: "2026-11-03"
difficulty: "easy"
kind: "Case study"
reading_minutes: 8
tags: ["sqlite","multi-tenancy","replication","ai-agents","system-design"]
---

# 2 million databases and counting: the architecture behind Sauna's AI teammate

A post on [Turso](https://swe.quest/sources/turso.md), published 2026-11-03, 8 min read, Case study. Original: [https://turso.tech/blog/2-million-databases-and-counting-the-architecture-behind-saunas-ai-teammate](https://turso.tech/blog/2-million-databases-and-counting-the-architecture-behind-saunas-ai-teammate)

## Summary

Sauna, a proactive AI work assistant, gives every session, agent and connected inbox or calendar its own Turso database, creating about 90,000 databases a day and over 2 million in total. The team moved from Cloudflare Durable Objects to Containers with Litestream, which proved slow and expensive, and switched to Turso once per-database pricing was removed. Turso Sync keeps each database as a local file with two-way sync: on a conflicting pull it atomically rolls back to the last synced state, applies remote changes and replays local writes. The database-per-connection model simplifies isolation between users and lets storage outlive compute when changing hosting providers.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [SQLite](https://swe.quest/tags/sqlite.md) (Data & databases)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)

## Prerequisites

- SQLite basics ([easy posts on SQLite](https://swe.quest/tags/sqlite.md?difficulty=easy))
- database replication ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

Turso, Turso Sync, Sauna, Litestream, Cloudflare Durable Objects, SQLite, MVCC

## Related posts

- [Building AI Agent Databases: A Complete Guide to Database-per-Agent Architecture](https://swe.quest/articles/building-ai-agent-databases-a-complete-guide-to-database-per-agent-architecture-e621ee857e5a5f4f.md): Turso · 2026-07-20 · Medium · 7 min read · Multi-tenancy, AI agents, SQLite, Local-first & sync, Vector search
  Giving each AI agent its own SQLite-style database, instead of sharing tables keyed by tenant\_id or using schema-per-tenant, makes isolation, debugging and cleanup trivial: deleting an agent is a single API call.
- [A database per agent: how Turso and Neon give different answers](https://swe.quest/articles/a-database-per-agent-how-turso-and-neon-give-different-answers-05d4b7fddc0c2ee5.md): Turso · 2026-11-12 · Easy · 10 min read · Multi-tenancy, Databases, AI agents, SQLite, PostgreSQL
  Neon and Turso both support a database per agent but differ in the unit: Neon gives each agent a Postgres project with its own autoscaling compute that suspends after 5 minutes idle and is billed by CU-hour, while Turso treats each SQLite-compatible database as a file managed by a shared server, billed by rows read/written and storage with unlimited databases on paid plans.
- [How Sample Vault syncs gigabyte-scale databases from cloud to local with Turso](https://swe.quest/articles/how-sample-vault-syncs-gigabyte-scale-databases-from-cloud-to-local-with-turso-df87236519a9ee42.md): Turso · 2026-05-04 · Easy · 6 min read · Local-first & sync, SQLite, Multi-tenancy, Replication
  Sample Vault, an AI sample browser for music producers, gives each premium user a dedicated Turso database.
- [Turso Cloud on AWS is now available for everybody](https://swe.quest/articles/turso-cloud-on-aws-is-now-available-for-everybody-1dc0ea860495bbb1.md): Turso · 2025-03-17 · Easy · 2 min read · SQLite, Storage engines, Multi-tenancy, Cloud platforms, Serverless
  Turso Cloud is now generally available on AWS, built on an S3-native architecture where every commit is made durable on S3 Express One Zone and local disks serve as a read cache.
- [Databases as Variables: What Unlimited Databases Actually Changes](https://swe.quest/articles/databases-as-variables-what-unlimited-databases-actually-changes-a5697bc287b26b2b.md): Turso · 2026-10-30 · Medium · 9 min read · Multi-tenancy, SQLite, System design, Schema migrations, Databases
  Turso Cloud's paid plans no longer meter active databases, so a database costs only its storage while idle.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
