---
title: "Litestream Writable VFS"
description: "Litestream’s VFS is being extended to support Sprites, whose storage stack needs SQLite-backed block maps to serve writes immediately during cold starts, before a full database or block map is available. The VFS indexes each database page by file, offset, and size in LTX files, serves reads from object storage, and now optionally buffers writes locally before syncing them roughly every second or on clean shutdown. Write mode assumes a single writer, disables polling, and offers only the same eventual durability already provided by Sprite storage. A separate hydration mode serves remote reads while reconstructing a complete database file in the background, then switches reads to that file; the temporary file is discarded on exit. These features target Sprite-like workloads, while ordinary Litestream sidecar deployments do not require them."
---

# Litestream Writable VFS

[Fly.io](https://yomu.fyi/company/fly-io) · Jan 29, 2026

**Type:** Problem & solution

## Summary

Litestream’s VFS is being extended to support Sprites, whose storage stack needs SQLite-backed block maps to serve writes immediately during cold starts, before a full database or block map is available. The VFS indexes each database page by file, offset, and size in LTX files, serves reads from object storage, and now optionally buffers writes locally before syncing them roughly every second or on clean shutdown. Write mode assumes a single writer, disables polling, and offers only the same eventual durability already provided by Sprite storage. A separate hydration mode serves remote reads while reconstructing a complete database file in the background, then switches reads to that file; the temporary file is discarded on exit. These features target Sprite-like workloads, while ordinary Litestream sidecar deployments do not require them.

## Context

Sprites need their SQLite-backed storage stack to serve writes milliseconds after a cold start, even when the full database or its block map has not been downloaded. Object-storage reads help with cold starts but are too slow for steady-state operation, and the original VFS could not write.

## Approach / What changed

The VFS adds optional single-writer read-write mode with a local write buffer synchronized to object storage periodically or during clean shutdown. It also adds background hydration, which serves reads from object storage while creating a temporary full database copy and switches to that file when hydration completes.

## Takeaways

- Writable VFS mode assumes a single writer, disables polling for remote LTX changes, and does not treat writes as durable until the write buffer syncs.
- The VFS stores page locations as file, offset, and size entries in LTX files, allowing requested pages to be fetched from object storage and cached without downloading the whole database.
- Hydration uses LTX compaction to write only the latest page versions into a temporary full database file; reads continue during hydration, and the file is discarded when the VFS exits.

**Tags:** [Litestream](https://yomu.fyi/topic/litestream), [Object Storage](https://yomu.fyi/topic/object-storage), [SQLite](https://yomu.fyi/topic/sqlite)

- Source: [Fly.io](https://fly.io/blog/litestream-writable-vfs)
- Source URL: https://fly.io/blog/litestream-writable-vfs
- Ingested by Yomu: 2026-09-02T12:00:41.498Z

[Read original post](https://fly.io/blog/litestream-writable-vfs)
