---
title: Building a serverless database replica with Carl Sverre
url: "https://aaronfrancis.com/videos/building-a-serverless-database-replica-with-carl-sverre"
path: "/videos/building-a-serverless-database-replica-with-carl-sverre"
type: video
author: Aaron Francis
published: 2025-04-18
topic: Databases
keywords: [graft, sqlite, database replication, serverless database, edge computing, sql sync, physical replication, object storage, s3 compatibility, tigris, fly.io, index-aware prefetching]
youtube_url: "https://www.youtube.com/watch?v=dJurdmhPLH4"
chunked: true
full_bytes: 84635
section_count: 22
full_url: "/videos/building-a-serverless-database-replica-with-carl-sverre/full.md"
site_index: "/llms.txt"
keyword_index: "/llms/keywords.txt"
---

# Building a serverless database replica with Carl Sverre

## Sections (82.7 KB full document — follow any link to read verbatim)

This page is long enough to hit agent truncation cliffs if fetched all at once. Pick the section matching your question below to read it 100% verbatim (< 35 KB each), or open the [full unsplit document (82.7 KB)](/videos/building-a-serverless-database-replica-with-carl-sverre/full.md).

### 1. Intro and Carl’s controversial blog title (00:01–01:24 · 1.5 KB)
Carl Sverre returns as a repeat guest to discuss his new blog post 'Stop Syncing Everything,' which challenges moving all data everywhere and proposes building web-native and edge-native database systems instead.
Keywords: `title`, `stop syncing`, `carl`, `carl controversial`, `controversial blog`, `blog title`, `intro`, `controversial`
[Read section 1 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/1-intro-and-carls-controversial-blog-title.md)

### 2. Why “stop syncing everything” doesn't mean stop syncing (01:25–02:38 · 1.7 KB)
The title 'Stop Syncing Everything' means SQLSync must selectively sync data rather than download entire databases, avoiding the inefficiency of syncing 100% of data to show users a single page.
Keywords: `stop syncing`, `syncing`, `syncing everything`, `sqlsync`, `sverre`, `mm-hmm`, `title`, `back-end`
[Read section 2 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/2-why-stop-syncing-everything-doesnt-mean-stop.md)

### 3. The problem with full database syncs (02:39–03:32 · 1.2 KB)
SQLSync is multiplayer SQLite that replicates raw SQLite database files across multiple places, but Carl realized it needed partial physical replication rather than syncing everything to every client.
Keywords: `sqlite`, `database`, `full database`, `database syncs`, `sqlsync`, `syncs`, `stay tuned`, `sverre`
[Read section 3 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/3-the-problem-with-full-database-syncs.md)

### 4. Quick recap of SQL Sync and multiplayer SQLite (03:32–04:57 · 1.6 KB)
SQLSync replicates the exact same SQLite database file bits and bytes across multiplayer systems, and Carl recognized it needed to support clients downloading only the subset of data they actually need via partial physical replication.
Keywords: `sqlite`, `sqlsync`, `sql sync`, `multiplayer sqlite`, `multiplayer`, `sql`, `sync`, `sqlite database`
[Read section 4 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/4-quick-recap-of-sql-sync-and-multiplayer-sqlite.md)

### 5. How SQL Sync works using physical replication (04:57–06:08 · 1.2 KB)
Graft is a new transactional storage engine enabling physical replication that is partial, allowing clients to pull only their needed data portion, and can back SQLite or handle any file system operations.
Keywords: `physical replication`, `physical`, `sql sync`, `sync works`, `sqlsync`, `replication`, `sqlite`, `sql`
[Read section 5 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/5-how-sql-sync-works-using-physical-replication.md)

### 6. The limitations that led to building Graft (06:08–09:00 · 3.3 KB)
SQLSync's traditional physical replication required sending all data to every client, which didn't scale to tens of thousands of clients, prompting Carl to realize he needed a fundamentally different architecture.
Keywords: `sqlsync`, `building graft`, `graft`, `limitations`, `led`, `sverre`, `replication`, `partial replication`
[Read section 6 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/6-the-limitations-that-led-to-building-graft.md)

### 7. What is Graft? A high-level overview (09:00–16:40 · 8.2 KB)
Graft is described through object storage semantics, trading off latency for throughput with a one-second commit heartbeat that dynamically decreases based on concurrent tenants, enabling efficient S3-backed database replication.
Keywords: `graft`, `sqlite`, `high-level overview`, `object storage`, `high-level`, `overview`, `sverre`, `object`
[Read section 7 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/7-what-is-graft-a-high-level-overview.md)

### 8. Syncing architecture: how Graft scales (16:40–18:19 · 2.0 KB)
Graft's one-second heartbeat latency per transaction is acceptable because clients decouple local write frequency from sync frequency, allowing 1,000 writes per second locally while Graft batches them into one sync per second.
Keywords: `graft`, `syncing architecture`, `graft scales`, `syncing`, `architecture`, `scales`, `sverre`, `client side`
[Read section 8 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/8-syncing-architecture-how-graft-scales.md)

### 9. Graft's stateless design and Fly.io integration (18:19–19:58 · 1.8 KB)
Graft Cloud runs on Fly.io with completely stateless server-side compute, horizontally scaling to infinity because all state guarantees come from the S3-compatible object store, with no consensus required.
Keywords: `graft cloud`, `graft`, `graft stateless`, `stateless design`, `io integration`, `stateless`, `fly`, `design`
[Read section 9 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/9-grafts-stateless-design-and-flyio-integration.md)

### 10. S3 compatibility and using Tigris as backend (20:00–22:03 · 2.7 KB)
Graft's managed service uses Tigris as its S3-compatible backend, and Graft works with any S3 API including R2, B2, MinIO, and native S3, with Carl recommending Tigris for its quality and Fly.io integration.
Keywords: `s3`, `tigris`, `s3 compatibility`, `minio`, `expresszone`, `compatibility`, `backend`, `sverre`
[Read section 10 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/10-s3-compatibility-and-using-tigris-as-backend.md)

### 11. Latency tuning and express zone support (22:03–24:07 · 2.5 KB)
Graft is currently optimized for cost with up-to-one-second latency, but Carl plans to add a configurable cost-latency slider allowing users to trade cost for lower latency including Express Zone and stateful proxy options.
Keywords: `latency`, `latency tuning`, `express zone`, `zone support`, `tuning`, `express`, `support`, `sverre`
[Read section 11 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/11-latency-tuning-and-express-zone-support.md)

### 12. Can Graft run locally or with Minio? (24:07–27:05 · 3.7 KB)
Graft is agnostic to backend storage and can run locally with MinIO in Docker or even with locally attached high-performance storage, though the architecture is optimized for leveraging cloud object storage economics.
Keywords: `graft`, `minio`, `graft run`, `run locally`, `locally`, `sverre`, `page store`, `store`
[Read section 12 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/12-can-graft-run-locally-or-with-minio.md)

### 13. Page store vs meta store in Graft (27:06–36:05 · 10.8 KB)
Graft has two servers: a page store that buffers writes to the blob and handles actual page data, and a lightweight meta store that tracks volume metadata, with separate scaling semantics allowing 10-100x more page stores than meta stores.
Keywords: `store`, `page store`, `meta store`, `graft`, `meta`, `store vs`, `vs meta`, `sqlite`
[Read section 13 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/13-page-store-vs-meta-store-in-graft.md)

### 14. Index-aware prefetching in SQLite (36:05–38:00 · 2.2 KB)
Clients send volume ID and snapshot version to the meta store, which responds with a compressed packet describing only which pages changed since the last pull, without containing any actual data.
Keywords: `sqlite`, `index-aware prefetching`, `index-aware`, `prefetching`, `snapshot version`, `sverre`, `volume`, `client`
[Read section 14 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/14-index-aware-prefetching-in-sqlite.md)

### 15. Prefetching intelligence: Graft vs driver (38:00–40:10 · 2.7 KB)
Graft turns replication into a cache coherency problem: clients receive a list of changed page indexes, mark local cached pages as good or bad, and only fetch from the server when reads require invalidated pages.
Keywords: `graft`, `prefetching intelligence`, `graft vs`, `vs driver`, `prefetching`, `intelligence`, `driver`, `sverre`
[Read section 15 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/15-prefetching-intelligence-graft-vs-driver.md)

### 16. The benefits of Graft's architectural simplicity (40:10–48:17 · 9.7 KB)
Graft operates at the bits-and-bytes layer for consistency guarantees, avoiding the complexity of row-level approaches that require metadata scanning and comparisons; two clients with identical bits and bytes see identical data.
Keywords: `sqlite`, `graft`, `graft sqlite`, `graft architectural`, `architectural simplicity`, `benefits`, `architectural`, `simplicity`
[Read section 16 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/16-the-benefits-of-grafts-architectural-simplicity.md)

### 17. Three use cases: apps, web apps, and replicas (48:18–50:14 · 2.6 KB)
Three main Graft use cases are mobile apps and devices needing efficient local data sync, collaborative web apps like Linear and Figma, and serverless database replicas that scale to 100,000 replicas at the cost of one traditional replica.
Keywords: `replicas`, `database replica`, `sverre`, `database`, `database replicas`, `able`, `serverless database`, `mm-hmm`
[Read section 17 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/17-three-use-cases-apps-web-apps-and-replicas.md)

### 18. Sync timing and perceived latency (50:15–59:00 · 10.4 KB)
In a web app collaboration scenario with one-second heartbeat, local writes appear instant to the user while updates to other collaborators wait up to one second plus network latency, with conflict resolution through replay or logical merging.
Keywords: `sync`, `sync timing`, `perceived latency`, `latency`, `timing`, `perceived`, `sverre`, `graft`
[Read section 18 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/18-sync-timing-and-perceived-latency.md)

### 19. Replaying transactions vs logical conflict resolution (59:00–1:03:11 · 4.2 KB)
Graft defaults to strict serializability with conflict replay for safety, but SQLSync layered on top can merge client transaction logs logically like CRDTs to handle collaborative conflicts without full replays.
Keywords: `sqlite`, `logical`, `replaying transactions`, `transactions vs`, `vs logical`, `logical conflict`, `conflict resolution`, `conflict`
[Read section 19 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/19-replaying-transactions-vs-logical-conflict-resol.md)

### 20. What’s next for Graft and how to get involved (1:03:11–1:05:00 · 2.1 KB)
Carl's roadmap includes a reliable managed service, an open-source community for collaboration, and imminent support for all major programming languages via NPM/pip/gem packages that make SQLite automatically Graft-powered.
Keywords: `graft`, `sqlite`, `involved`, `sverre`, `npm install`, `install`, `suddenly`, `go`
[Read section 20 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/20-whats-next-for-graft-and-how-to-get-involved.md)

### 21. Hacker News reception and blog post feedback (1:05:00–1:06:32 · 2.0 KB)
The blog post received 600+ upvotes, 24 hours on Hacker News front page, and ~100,000 unique readers, with community understanding and appreciation for the hybrid partial-physical replication approach and transactional semantics.
Keywords: `hacker news`, `hacker`, `news`, `news reception`, `post feedback`, `reception`, `feedback`, `sverre`
[Read section 21 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/21-hacker-news-reception-and-blog-post-feedback.md)

### 22. Closing thoughts and where to find Carl (1:06:33–1:10:18 · 4.8 KB)
Carl thanks Aaron for excellent questions and invites listeners to contribute on GitHub, file issues, and join the Discord community; both confirm links to blog post and repo will be provided below.
Keywords: `hacker news`, `carl`, `closing thoughts`, `find carl`, `github`, `closing`, `thoughts`, `sverre`
[Read section 22 verbatim](/videos/building-a-serverless-database-replica-with-carl-sverre/sections/22-closing-thoughts-and-where-to-find-carl.md)

---

## Related on aaronfrancis.com

- [Remix with Kent C. Dodds](/podcast/remix-with-kent-c-dodds-528af99d) *(Podcast · 2022-06-27 · shared: edge computing, fly.io, sqlite)*
- [Migrating from Postgres to SQLite with Kent C. Dodds](/videos/migrating-from-postgres-to-sqlite-with-kent-c-dodds) *(Video · 2024-06-20 · shared: sqlite, fly.io, database replication)*
- [Developer to Business Owner](/podcast/developer-to-business-owner-3adb2856) *(Podcast · 2024-08-06 · shared: sqlite, fly.io)*
- [Static site generators & personal websites](/podcast/static-site-generators-personal-websites-knj6zl) *(Podcast · 2023-12-14 · shared: sqlite, fly.io)*
- [Production SQLite with Turso and libSQL](/videos/production-sqlite-with-turso-and-libsql) *(Video · 2024-06-14 · shared: sqlite, database replication)*

## Relevant Resources from Aaron Francis

- **[MySQL for Developers](https://databaseschool.com)** (overview on site: [/courses](/courses)): Full video course covering MySQL indexing, deferred joins, pagination, query plans, and schema design for application developers.
- **[High Performance SQLite](https://databaseschool.com)** (overview on site: [/courses](/courses)): Comprehensive video course on running SQLite in production: WAL mode, concurrency, FTS5, strict tables, backups, and performance tuning.

## Search aaronfrancis.com (2-Hop Static Keyword Index)

Pick the alphabetical shard matching any topic to find exact pages across all articles, newsletters, videos, talks, and podcast transcripts (every shard is < 40 KB):
[A-B](/llms/keywords/a-b.txt) · [C](/llms/keywords/c.txt) · [D-E](/llms/keywords/d-e.txt) · [F-G](/llms/keywords/f-g.txt) · [H-J](/llms/keywords/h-j.txt) · [K-L](/llms/keywords/k-l.txt) · [M-N](/llms/keywords/m-n.txt) · [O-P](/llms/keywords/o-p.txt) · [Q-R](/llms/keywords/q-r.txt) · [S](/llms/keywords/s.txt) · [T-Z](/llms/keywords/t-z.txt) · [Directory](/llms/keywords.txt) · [Site Map](/llms.txt)

Shards for this page's topics: `graft` ([F-G](/llms/keywords/f-g.txt)), `sqlite` ([S](/llms/keywords/s.txt)), `database replication` ([D-E](/llms/keywords/d-e.txt)), `physical replication` ([O-P](/llms/keywords/o-p.txt)).

## About Aaron Francis (Current Context)

Aaron Francis is VP of Marketing and Community at [Laravel](https://laravel.com), founder of [Try Hard Studios](https://tryhardstudios.com), creator of [Solo](https://soloterm.com), co-host of [Mostly Technical](/podcast), and author of [Mastering Postgres](/courses), [High Performance SQLite](/courses), [MySQL for Developers](/courses), and [Screencasting.com](/courses). Full bio: [/about](/about) · Current focus: [/now](/now).
