opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Litestream: standalone disaster recovery for SQLite, replicating changes to S3
GitHub RepoImpressions1

Project Description

View on GitHub

Litestream: Simple Disaster Recovery for SQLite — Direct to S3

If you’ve ever built something with SQLite and thought “this is great, but what happens when my server dies?” you’re not alone. SQLite is fantastic for small to medium projects, but its lack of built-in replication or point-in-time recovery has kept people away from using it in production.

Enter Litestream — a standalone tool that replicates your SQLite database changes to S3 (or any S3-compatible storage) in real time. No complex setups, no heavy infrastructure, just a small Go binary and a config file.

What It Does

Litestream runs alongside your application and watches for changes to your SQLite database file. Every time a write happens (via WAL checkpoints), it streams those changes to an S3 bucket. If your database ever gets corrupted or your server dies, you can restore from the S3 backup — even to a specific point in time.

It works at the file system level, so it’s completely transparent to your app. You don’t need to modify your code or use a special SQLite driver.

Why It’s Cool

  • No dependencies — no databases, no queues, just S3. Single binary, zero runtime deps.
  • Minimal configuration — a simple YAML file or environment variables. That’s it.
  • Point-in-time recovery — restore to any moment in the past, not just the last snapshot.
  • Plays well with others — works with serverless, containers, and any Linux/macOS host.
  • Open source and self-hostable — no vendor lock-in. You control your backups.

For devs who love SQLite’s simplicity but need production durability, this is a game changer. It’s like having continuous database archiving without the complexity of Postgres or MySQL replication.

How to Try It

  1. Install Litestream on your machine or server:
# macOS
brew install litestream

# Linux (download from releases)
wget https://github.com/benbjohnson/litestream/releases/latest/download/litestream-linux-amd64.tar.gz
tar -xzf litestream-linux-amd64.tar.gz
sudo mv litestream /usr/local/bin/
  1. Create a config file (litestream.yml):
dbs:
  - path: /data/myapp.db
    replicas:
      - url: s3://my-bucket/db
        access-key-id: $AWS_ACCESS_KEY_ID
        secret-access-key: $AWS_SECRET_ACCESS_KEY
  1. Run your app with Litestream:
litestream replicate -config litestream.yml

Then in a separate terminal, start your app that writes to /data/myapp.db. Litestream will automatically start replicating changes.

  1. Restore later with:
litestream restore -o /data/myapp.db s3://my-bucket/db

Check the GitHub repo for full docs, including how to run it in Docker or Kubernetes.

Final Thoughts

Litestream is not for every use case. If you need multi-writer or real-time replication, SQLite isn’t the right choice anyway. But for the vast majority of single-server applications, sidekiq-style workers, or embedded devices, this tool makes SQLite production-ready without the usual headaches.

It’s a rare example of a tool that solves a real pain point elegantly, with no bloat, no hype, and a clear focus on simplicity. If you’re already using SQLite, give it a spin. If you’ve avoided SQLite because of backup concerns, this might change your mind.


Found this on @githubprojects

Back to Projects
Project ID: 55b94f3a-6ddb-4940-a219-2bdfc48f442aLast updated: July 6, 2026 at 02:43 AM