KS
Killer-Skills

litestream — how to use litestream how to use litestream, litestream alternative, litestream setup guide, what is litestream, litestream vs database replication tools, litestream install for AI assistants, SQLite disaster recovery, LTX file format, WAL monitoring interval

v0.5.5
GitHub

About this Skill

Ideal for AI Assistant Developers utilizing SQLite databases and requiring continuous replication for disaster recovery purposes. litestream is a background process that replicates SQLite database changes to cloud storage, ensuring data integrity and disaster recovery

Features

WAL Monitoring: watches SQLite Write-Ahead Log for changes at configurable intervals
LTX File generation: converts database page changes to immutable files
Cloud storage upload: seamlessly uploads LTX files to chosen storage backend
Configurable intervals: allows for customizable monitoring intervals, defaulting to 1s
Immutable LTX files: ensures database page changes are never modified

# Core Topics

benbjohnson benbjohnson
[0]
[0]
Updated: 3/6/2026

Quality Score

Top 5%
59
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add benbjohnson/litestream-skills/litestream

Agent Capability Analysis

The litestream MCP Server by benbjohnson is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use litestream, litestream alternative, litestream setup guide.

Ideal Agent Persona

Ideal for AI Assistant Developers utilizing SQLite databases and requiring continuous replication for disaster recovery purposes.

Core Value

Empowers agents to maintain immutable LTX files through continuous database replication, leveraging SQLite Write-Ahead Log monitoring and cloud storage upload capabilities, ensuring data integrity via WAL monitoring and LTX file conversion.

Capabilities Granted for litestream MCP Server

Replicating SQLite databases to cloud storage for disaster recovery
Monitoring SQLite Write-Ahead Logs for real-time change detection
Converting database changes to immutable LTX files for version control

! Prerequisites & Limits

  • Requires SQLite database
  • Cloud storage backend needed for replication
  • Runs as a background process
Project
SKILL.md
5.0 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

Litestream

Litestream is a disaster recovery tool for SQLite that runs as a background process, continuously replicating database changes to cloud storage. It monitors the SQLite Write-Ahead Log (WAL), converts changes to immutable LTX files, and uploads them to your chosen storage backend.

Key Concepts

  • WAL Monitoring: Watches SQLite Write-Ahead Log for changes at configurable intervals (default 1s)
  • LTX Files: Immutable files containing database page changes, never modified after creation
  • Level-Based Compaction: Multi-level system (L0-L9) that merges LTX files to reduce storage overhead
  • Point-in-Time Recovery: Restore to any transaction using TXID or timestamp
  • VFS Support: Read replicas directly from cloud storage without local database copy
  • MCP Server: AI tool integration for automated database management

Quick Start

Installation

bash
1# macOS 2brew install litestream 3 4# Linux (Debian/Ubuntu) 5wget https://github.com/benbjohnson/litestream/releases/download/v0.5.5/litestream-v0.5.5-linux-amd64.deb 6sudo dpkg -i litestream-v0.5.5-linux-amd64.deb 7 8# Docker 9docker pull litestream/litestream:0.5

Basic Replication

bash
1# Command line (single database) 2litestream replicate /path/to/db.sqlite s3://bucket/db 3 4# With config file 5litestream replicate -config /etc/litestream.yml

Restore Database

bash
1# Restore latest backup 2litestream restore -o /path/to/restored.db s3://bucket/db 3 4# Point-in-time recovery 5litestream restore -timestamp 2024-01-15T10:30:00Z -o /tmp/db s3://bucket/db 6 7# Restore to specific transaction 8litestream restore -txid 1000 -o /tmp/db s3://bucket/db

Check Status

bash
1# View all databases and their replication status 2litestream status 3 4# List available LTX files 5litestream ltx /path/to/db.sqlite

Critical Rules

These rules are essential for correct Litestream operation:

  1. Lock Page at 1GB: SQLite reserves the page at offset 0x40000000 (1GB). This page must always be skipped during replication and compaction. The page number varies by page size:

    • 4KB pages: page 262145
    • 8KB pages: page 131073
    • 16KB pages: page 65537
  2. LTX Files are Immutable: Once created, LTX files are never modified. New changes create new files.

  3. Single Replica per Database: Each database can only replicate to one destination. Use multiple Litestream instances for multiple destinations.

  4. WAL Mode Required: SQLite must be in WAL mode (PRAGMA journal_mode=WAL;)

  5. Use litestream ltx: The litestream wal command is deprecated.

Storage Backends

BackendURL SchemeExample
AWS S3s3://s3://bucket/path
S3-Compatible (R2, Tigris, MinIO)s3://s3://bucket/path?endpoint=host:port
Google Cloud Storagegs://gs://bucket/path
Azure Blob Storageabs://abs://container@account/path
SFTPsftp://sftp://user@host:22/path
NATS JetStreamnats://nats://host:4222/bucket
WebDAVwebdav://webdav://host/path
Alibaba OSSoss://oss://bucket/path
Local File(path)/var/backups/db

Configuration File Example

yaml
1dbs: 2 - path: /data/app.db 3 replica: 4 url: s3://my-bucket/app-backup 5 access-key-id: ${AWS_ACCESS_KEY_ID} 6 secret-access-key: ${AWS_SECRET_ACCESS_KEY} 7 region: us-east-1 8 sync-interval: 1s

When to Use This Skill

Use Litestream skill when:

  • Configuring SQLite database replication to cloud storage
  • Setting up disaster recovery for SQLite applications
  • Troubleshooting replication issues (WAL growth, sync failures)
  • Implementing point-in-time recovery procedures
  • Deploying Litestream with Docker, Fly.io, Kubernetes, or systemd
  • Understanding WAL-based replication concepts

Skill Contents

  • concepts/ - Architecture, replication mechanics, LTX format, SQLite WAL, VFS support, compaction
  • configuration/ - Storage backend configurations (S3, GCS, Azure, SFTP, NATS, OSS, WebDAV, File)
  • commands/ - CLI command reference (replicate, restore, status, ltx, databases)
  • operations/ - Monitoring, troubleshooting, recovery, and heartbeat monitoring
  • deployment/ - Docker, Fly.io, Kubernetes, and systemd deployment guides
  • integrations/ - MCP server integration for AI tools
  • scripts/ - Validation and diagnostic helper scripts

Common Issues

WAL Growing Too Large

  • Check sync interval (default 1s may be too slow for write-heavy workloads)
  • Verify storage backend connectivity
  • Check for checkpoint blocking (long-running transactions)

Replication Lag

  • Monitor with litestream status
  • Check network connectivity to storage backend
  • Review sync interval configuration

Restore Failures

  • Verify backup exists: litestream ltx /path/to/db
  • Check storage backend credentials
  • Ensure target directory is writable

Links

Related Skills

Looking for an alternative to litestream or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication