SBD: We Have a Filesystem at Home
Fly.io replaced the modified JuiceFS stack behind Sprites with the Sprites Block Device (SBD), which exposes an object storage bucket to the Linux kernel as an NBD block device formatted with ext4. The old design kept data chunks, a Litestream-backed SQLite metadata database and a separate checkpoints database consistent with each other. In writeback mode, a machine killed between recording metadata and uploading a chunk left dangling references that corrupted every clone-based checkpoint. SBD stores its metadata in the bucket beside the blocks, uses a single daemon with a local cache and background uploads, makes checkpoints versioned block snapshots, and verifies every block read back, restarting the Sprite rather than running on an untrusted disk. A torture-test harness driving write/checkpoint/sleep/wake/restore cycles showed SBD to be orders of magnitude more reliable.
Related posts
- The Design & Implementation of Sprites
Fly.io mediumAdeptSprites are Linux microVMs that create in a second or two, carry a 100GB durable root filesystem and sleep automatically when idle. Three design decisions separate them from Fly Machines. Every Sprite starts from one standard container, so workers keep pre-warmed pools. Durable state lives on S3-compatible object storage through a modified JuiceFS with a SQLite metadata backend made durable by Litestream, with NVMe serving only as a read-through chunk cache. Most orchestration runs inside the VM's root namespace, around an inner user container. The tradeoffs: checkpoint/restore becomes a cheap metadata operation and migration becomes trivial, but object-backed disks and aggressive sleeping are a poor fit for hot production databases and latency-sensitive apps, which stay on Fly Machines.
- Litestream Writable VFS
Fly.io mediumAdeptLitestream's SQLite VFS now supports an optional write mode and background hydration, built so the Sprites storage stack can serve reads and writes milliseconds after a cold boot without first downloading its JuiceFS block map from object storage. Write mode assumes a single writer, disables polling for remote LTX files, and buffers writes locally, syncing them to S3 about every second. That gives 'eventual durability' that suits Sprites but probably not most applications. Hydration serves reads from object storage while pulling a compacted full copy of the database into a temporary local file, then switches reads to that file once it is ready. Ordinary workloads should keep running Litestream as a sidecar instead.
- Building fast filesystems for VMs
Modal hardMaster
Modal replaced virtio-fs with a custom virtio-blk backend, ImageFS-blk, for its VM Sandboxes. Under virtio-fs every metadata operation crosses the VM boundary: one chown cost three guest-to-host FUSE round trips and six host syscalls. ImageFS-blk synthesizes ext4 inode and extent metadata from lazily loaded image metadata, leaves file data sparse, and serves blocks on demand from a tiered cache. Writes go to a sparse file tracked by a dirty bitmap, giving block-level copy-on-write. Metadata operations now stay in the guest's ext4 journal (chown drops from ~99 µs to ~2.1 µs), bun install runs 12x faster (12.5s to 1.07s), and sub-second cold starts are preserved.
- An adventure in writing compatible systems
Turso mediumAdeptTurso, a Rust rewrite of SQLite, hit a bug where every write after the database crossed 1GB made SQLite's integrity checks fail, even though Turso's own checks found the file intact. The cause was the SQLite "pending byte" page: once a file passes the 1GB mark, SQLite reserves a special page tied to file locking, and Turso did not reserve it. The deterministic simulation tests had missed the bug because every profile injected faults, so no test database ever grew to 1GB. Adding fault-free runs fixed that gap, a reminder that compatible rewrites must match undocumented-feeling quirks of the original implementation.
- Making multiplayer more reliable
Figma mediumAdept
Figma added a write-ahead journal to its in-memory multiplayer service, which previously persisted files only via full checkpoints to S3 every 30–60 seconds. Incremental changes are now batched and written to DynamoDB with sequence-number ranges. File ownership is enforced with a lock table and conditional writes to prevent split-brain corruption. Cross-region durability comes from guaranteeing a checkpoint within 30 minutes, since DynamoDB global tables would have cost about 6x more. After ~400K byte-identical replay validations during a dark launch, the journal handles over 2.2B changes per day, persists 95% within ~600ms, and removes checkpoint write spikes during deploys.