SQLite Replication Selection Playbook: LiteFS vs Litestream

2026-04-12 · software

SQLite Replication Selection Playbook: LiteFS vs Litestream

Date: 2026-04-12
Category: knowledge
Domain: software / sqlite / distributed systems

Why this matters

A lot of teams want SQLite because it is fast, boring, embeddable, and cheap to operate—and then immediately run into the same question:

How do I make it survive machine loss, region loss, or multi-instance deployment without accidentally rebuilding a bad database cluster?

Two of the most interesting answers in the SQLite ecosystem are:

They are related, but they are not interchangeable.

If you pick the wrong one, you usually get one of these failure modes:

The clean split is:

That one sentence is the shortcut.


1) Fast mental model

Litestream

Think of Litestream as:

Good default fit:

LiteFS

Think of LiteFS as:

Good default fit:

The core difference:


2) The decisive architectural question

The first question is not:

“Do I need replication?”

It is:

“Am I solving disaster recovery, or am I solving live multi-node serving?”

Pick Litestream when the center of gravity is recovery

Choose Litestream when you mainly want:

Typical examples:

Pick LiteFS when the center of gravity is live topology

Choose LiteFS when you mainly want:

Typical examples:


3) How Litestream actually works

Litestream continuously copies SQLite changes to replica storage. Historically people think of it as “WAL shipping,” which is directionally right, but the operationally important idea is:

Important operational traits:

Recent Litestream docs also make two useful points that are easy to miss:

  1. follow mode can keep a restored DB continuously updated as a read-only follower,
  2. the newer VFS replica path can serve read-only queries directly from replica storage without restoring the full DB to local disk first.

That means Litestream is no longer just “backup and pray later.” It can support read-only workflows more elegantly than older summaries imply.

But the important limit remains:

Litestream does not turn SQLite into an automatically failing-over primary/replica cluster.


4) How LiteFS actually works

LiteFS sits between SQLite and the underlying filesystem using FUSE. It intercepts SQLite file operations, captures committed page changes, packages them as LTX transactions, and replicates those transactions to other nodes.

Important operational traits:

LiteFS also tracks a replication position using TXID + checksum, which helps detect divergence and recover from split-brain-style drift by resnapshotting from the current authoritative primary.

The design is elegant, but it has real consequences:

The LiteFS docs explicitly call out a rough write-throughput ceiling around ~100 transactions/sec from the FUSE approach, which is a huge clue:

LiteFS is for “SQLite but distributed,” not “SQLite but suddenly a high-write consensus database.”


5) The most practical comparison

A) If you have one app instance

Use Litestream by default.

Why:

This is the most common “don’t get cute” answer.

If the app is single-writer and your real problem is “I need backups that aren’t on the same disk,” Litestream is the clean winner.

B) If you have several app instances and want local reads everywhere

Use LiteFS.

Why:

This is where Litestream starts to feel stretched. It can support read-only replica patterns, but not the same live primary/replica serving model.

C) If you need automatic failover of the write node

Use LiteFS, but be honest about the semantics.

LiteFS can do primary handoff/election via Consul-based lease management. That gives you a real failover path, but not synchronous quorum durability.

So the promise is:

If you need “a committed write survives leader loss unless quorum is gone,” you are in rqlite / dqlite / Postgres / another client-server DB territory.

D) If you want the smallest operational surface area

Use Litestream.

The object-storage replication story is easier to reason about than FUSE mounts, lease coordination, primary routing, and replica-consistency behavior.


6) Selection table

Situation Better fit Why
Single VM / single container SQLite app Litestream DR without cluster complexity
Simple SQLite app with S3/R2/GCS backups Litestream Strong backup/restore ergonomics
Need PITR / restore by timestamp Litestream Built around snapshot + WAL/LTX recovery
Multi-node deployment with one write leader LiteFS Live replication across instances
Multi-region app serving mostly local reads LiteFS Local disk reads on replicas
Need automatic primary failover LiteFS Lease/election model supports it
Need multi-writer cluster Neither SQLite single-writer model still rules
Need synchronous quorum durability Neither Use Raft-based or client/server DB
Need read-only analytics off replica storage Litestream Restore/follow mode or VFS can work well
Very write-heavy workload Usually neither LiteFS FUSE overhead and SQLite single-writer limits become painful

7) Litestream’s strengths in real life

A) Disaster recovery is the product, not a side effect

Litestream is excellent when your top concern is:

“If this box disappears, how fast and how confidently can I reconstruct the DB?”

That maps well to:

The newer restore docs are especially nice operationally because they support:

That last bit matters more than it sounds:

good restore tooling reduces the amount of shell duct tape your deployment has to invent.

B) It fits the “single primary app” shape naturally

Many teams do not actually need multi-node writes or local replicas on every server. They need:

Litestream is almost purpose-built for this.

C) Read-only offload is possible without pretending it is HA

Follow mode and the VFS path open useful read-only patterns:

That is valuable because it lets you separate serving writes from reading historical/replicated state without demanding a full database migration.


8) LiteFS’s strengths in real life

A) Local reads on every app node are the whole game

When you deploy an app globally, a remote database hop can dominate latency. LiteFS’s magic trick is simple but powerful:

This can feel dramatically better than remote-DB patterns for read-heavy web apps.

B) The built-in proxy solves a real class of pain

LiteFS includes an HTTP proxy that can:

That sounds small, but it closes an annoying consistency gap for normal web applications.

The catch is that your app needs to respect the proxy’s assumptions:

If your app violates REST semantics or uses weird side effects on reads, the proxy becomes less helpful.

C) It gives you a real failover story while staying in SQLite land

LiteFS is compelling because it lets teams push SQLite farther before graduating to a client/server DB.

That can be the right choice when:


9) The traps and failure modes

Litestream traps

1) Expecting HA when you only bought DR

This is the big one. Litestream gives you recovery, not automatic live-primary election.

If your app truly needs:

then Litestream alone is the wrong abstraction.

2) Retention that looks fine until you actually restore

Point-in-time recovery is only as good as:

If you never test restores, you do not have a DR system. You have a storage bill.

3) Misusing VFS for heavy analytics

The VFS feature is cool, but it is still read-only and network-bound. It is great for:

It is not the first thing I would choose for:

LiteFS traps

1) Forgetting it is still asynchronous

LiteFS can fail over, but asynchronous replication means a just-committed write can still be lost if the primary dies before replicas receive it.

That is not a bug. That is the durability tradeoff.

2) Underestimating write-path constraints

FUSE is clever, but it is not free. If your workload is chatty, write-heavy, or filled with tiny high-frequency transactions, LiteFS may become the thing you fight.

3) Pretending single-writer discipline will disappear

LiteFS does not change SQLite’s fundamental single-writer shape. It operationalizes it across nodes. That is very useful—but it is not multi-primary magic.

4) Ignoring lease/primary-routing details

If the application has no clean strategy for:

then deployment pain will leak into the app.


10) A simple decision framework

Use this in order.

Choose Litestream if most of these are true

Choose LiteFS if most of these are true

Choose neither if most of these are true

At that point, stop being sentimental and use a client/server database.


11) Recommended deployment patterns

Pattern A: Single-node app, cheap and solid

Use:

This is the default answer for a surprising number of real products.

Pattern B: Primary app node + DR standby

Use:

This is not fully automatic HA, but it is often plenty.

Pattern C: Multi-region read-heavy app on SQLite

Use:

LiteFS solves live replication. You still need a backup story.

Pattern D: Read-only analytics from production SQLite

Use:

This is a nice way to offload reads without forcing a full database migration.


12) My opinionated default

If you are unsure:

That bias exists because:

LiteFS is impressive and real, but it should be chosen because the topology demands it, not because it sounds cool.


13) Bottom line

If you remember only one thing, remember this:

SQLite can go farther than many people think. But the smartest move is usually not “how far can I stretch it?” It is:

“Which failure mode am I actually buying, and am I buying it on purpose?”


References