Skip Runtime / Cloud Native Storage

Technology Guide

Litestream

License: Apache-2.0

Litestream Logo

Field Guide

Complete Guide

Litestream is a streaming replication tool for SQLite, written in Go by Ben Johnson (the author of BoltDB). It runs as a sidecar process next to an application that uses SQLite and ships the database’s write-ahead log to object storage in near-real-time.

Litestream opens the SQLite database in WAL mode, takes a shared lock, and tails the WAL file. New frames are batched into small segments and uploaded to S3, GCS, Azure Blob, SFTP, or a local filesystem, along with periodic full snapshots. Because it only reads the WAL, the application keeps writing without blocking, and there is no Litestream-aware client — existing SQLite code is unchanged. Recovery is done with litestream restore, which reconstructs the database from the latest snapshot plus replayed WAL segments, producing a point-in-time copy.

Litestream turns SQLite into a viable primary store for single-node web apps that want cheap, continuous backups without running Postgres. It is often paired with Fly.io-style single-VM deployments and is the spiritual predecessor to LiteFS, Johnson’s follow-up project that adds distributed replicas on top of the same idea.

No articles found for Litestream yet. Check back soon!