
Ship It! Cloud, SRE, Platform Engineering Postgres vs SQLite with Litestream
Local SQLite Cuts Query Latency
- SQLite offers dramatically lower local query latency compared with remote Postgres, often microseconds vs milliseconds.
- That latency difference changes how you design apps and reduces need for caches and complex infra.
Shard By Database To Avoid Concurrency
- SQLite pairs well with sharding or one-database-per-tenant to avoid write-concurrency limits.
- Splitting data into many small databases enables parallel writes and isolates user data.
Snapshot And Compact WAL For Faster Restores
- Compact WAL and use snapshots to speed replica boot and restores.
- Tune snapshot frequency to balance restore time versus upload cost for point-in-time recovery.
Ben Johnson, the creator of Litestream, joined Fly.io a few weeks after we migrated changelog.com - episode 50 has all the details. That was pure coincidence. What was not a coincidence, is Gerhard jumping at the opportunity to talk to Ben about Postgres vs SQLite with Litestream.
The prospect of running a cluster of our app instances spread across all regions, with local SQLite & Litestream replication, is mind boggling. Let’s find out from Ben what will it take to get there. Thanks Kürt for kicking off this dream.
Changelog++ members save 6 minutes on this episode because they made the ads disappear. Join today!
Sponsors:
- Sentry – Working code means happy customers. That’s exactly why teams choose Sentry. From error tracking to performance monitoring, Sentry helps teams see what actually matters, resolve problems quicker, and learn continuously about their applications - from the frontend to the backend. Use the code
SHIPITand get the team plan free for three months. - FireHydrant – The reliability platform for every developer. Incidents impact everyone, not just SREs. FireHydrant gives teams the tools to maintain service catalogs, respond to incidents, communicate through status pages, and learn with retrospectives. Small teams up to 10 people can get started for free with all FireHydrant features included. No credit card required to sign up. Learn more at firehydrant.io
- Sourcegraph – Transform your code into a queryable database to create customizable visual dashboards in seconds. Sourcegraph recently launched Code Insights — now you can track what really matters to you and your team in your codebase. See how other teams are using this awesome feature at about.sourcegraph.com/code-insights
- Akuity – Akuity is a new platform (founded by Argo co-creators) that brings fully-managed Argo CD and enterprise services to the cloud or on premise. They’re inviting our listeners to join the closed beta at akuity.io/changelog. The platform is a versatile Kubernetes operator for handling cluster deployments the GitOps way. Deploy your apps instantly and monitor their state — get minimum overhead, maximum impact, and enterprise readiness from day one.
Featuring:
Show Notes:
🆕 FOLLOW-UP: Live read replicas update in GitHub issue comment
- How this episode started
- I’m All-In on Server-Side SQLite
- Getting Started with Litestream
- github.com/benbjohnson/litestream
- litestream.io repository
- The Secret Lives of Data - Raft
- 🎧 Replicating SQLite using Litestream with Ben Johnson - ThinkingElixir #101 - May, 2022
- 🎧 Open source, not open contribution - Changelog #433 - March, 2021
- Datasette - An open source multi-tool for exploring and publishing data
- How Litestream Eliminated My Database Server for $0.03/month - April, 2021
- Picoshare - A minimalist, easy-to-host service for sharing images and other files
- Picoshare deploy to Fly.io
- Fly Machines: An API for Fast-booting VMs
Something missing or broken? PRs welcome!
