FIFO KV-Ratio Compaction for BlobDB-Backed TTL Workloads
RocksDB 11.0 adds a KV-ratio intra-L0 compaction picker for FIFO compaction with integrated BlobDB. It targets workloads with large values, point lookups and TTL or size-bounded expiry. The old cost-based picker compares SST sizes against write_buffer_size, so BlobDB's tiny SSTs never stop growing. The new picker derives a target SST size from max_data_files_size × (SST bytes / total bytes) ÷ level0_file_num_compaction_trigger, then merges files through geometric size tiers until they graduate. This keeps blob files untouched and SST rewrite cost logarithmic, at the cost of some intermediate tier files lingering in L0.
Related posts
- Husky: Efficient compaction at Datadog scale
Datadog Engineering hardMasterHusky, Datadog's observability event store layered over object storage, keeps query cost low by controlling fragment count and layout through streaming compaction. Writers flush small sorted fragments into time-bucketed tables. Compactors lazily run size-tiered k-way merges, waiting until a few dozen fragments are available, which cuts CPU and object-store API costs by an order of magnitude. Metadata is swapped atomically in FoundationDB. A custom columnar format with per-column headers and fixed-size row groups lets each compaction use one GET per input, saturate the CPU and run in bounded memory, and sort schemas let queries skip fragments using only their metadata.
- How we scale an open source, multi-tenant storage engine for Postgres written in Rust
Neon mediumAdept
Neon shards its Rust-based Pageserver storage layer by dividing each Postgres relation's 8KiB block numbers into stripes (default 256MiB) and hashing each stripe to a Pageserver. Large tenants then get I/O that scales with dataset size, and they stop competing with small tenants for resources. All shards subscribe to the Paxos-based Safekeepers and filter WAL down to their own pages, while Postgres routes GetPage@LSN reads directly to the right shard by hashing, with no proxy in between. Tables need to exceed stripe size × shard count (e.g. 2GiB with 8 shards) to use full throughput. Planned work includes shard-aware Safekeepers to cut WAL fan-out cost and shard splitting, since shard count is currently fixed at tenant creation.
- Recent Storage Performance Improvements at Neon
Neon hardMaster
Neon shipped a set of storage-layer optimizations across Safekeepers and Pageservers. WAL is now decoded once at Safekeepers and routed only to the relevant shard, which roughly doubles ingest throughput for large tenants. Protobuf-encoded, Zstd-compressed WAL cuts Safekeeper-to-Pageserver bandwidth by about 70%. Sparse files via ftruncate and fewer fsyncs give about 3.3x WAL write throughput. Scan prefetching of up to 100 pages made schema finalization 4x faster, prioritizing L0 compaction with ingest backpressure halved p99 read amplification, pipelined parallel S3 uploads doubled upload rate, and a graduated shard split policy (4/8/16 shards at 16 GB/1 TB/2 TB) improves mid-size and very large tenants.
- Litestream Revamped: SQLite Replication
Fly.io mediumAdeptLitestream is being reworked around ideas from LiteFS. It replaces the raw-WAL "shadow WAL" with transaction-aware LTX files, sorted page changesets that can be compacted LSM-style, so point-in-time restores no longer replay every intermediate page write. Conditional writes in S3 and Tigris provide a time-based lease that guarantees a single writer per destination without Consul, which removes the need for multiple "generations" and makes failover and replica resync simpler. Planned additions are a VFS-based read-replica layer that fetches and caches pages straight from object storage, and wildcard replication of hundreds or thousands of databases from one process.
- Beyond FTS5: Building Transactional Full-Text Search in TursoDB
Turso mediumAdeptTursoDB adds native full-text search by embedding Tantivy and implementing its Directory trait on top of Turso's B-tree, storing index "files" as 512KB chunks in an internal table. Because of this design, index updates share the SQL transaction, WAL, rollback and single-file storage, and indexes are created with Postgres-style `CREATE INDEX ... USING fts` syntax with configurable tokenizers, BM25 column weights, MATCH and highlighting. A hybrid cache keeps metadata resident, caches hot small files (term dictionaries, fast fields) whole, and lazy-loads large segment data by chunk. Background merges conflict with single-writer transactional storage, so automatic merging is disabled via NoMergePolicy. An explicit `OPTIMIZE INDEX` command handles compaction, similar to VACUUM or ANALYZE.