# FIFO KV-Ratio Compaction for BlobDB-Backed TTL Workloads

DevFeed: [FIFO KV-Ratio Compaction for BlobDB-Backed TTL Workloads](<https://devfeed.tech/articles/fifo-kv-ratio-compaction-for-blobdb-backed-ttl-workloads-22401.md>)

Original publisher: [Read original article](<http://rocksdb.org/blog/2026/06/20/fifo-kv-ratio-compaction.html>)

Author: Xingbo Wang

Published: 2026-06-20T00:00:00Z

Content type: article

Language: en

Sources: [RocksDB](<https://devfeed.tech/sources/rocksdb.md>)

Topics: [rocksdb](<https://devfeed.tech/topics/rocksdb.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [cost](<https://devfeed.tech/tags/cost.md>), [files](<https://devfeed.tech/tags/files.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>), [rocksdb](<https://devfeed.tech/tags/rocksdb.md>), [time](<https://devfeed.tech/tags/time.md>)

## AI overview

This article explains FIFO KV-ratio compaction in RocksDB 11.0 for BlobDB-backed workloads with large values, point lookups, and TTL or bounded-size expiration. The new picker uses the ratio of SST bytes to blob bytes to select a target SST size and reduce the read overhead caused by many small L0 files.

## Source excerpt

RocksDB 11.0 added CompactionOptionsFIFO::max_data_files_size and CompactionOptionsFIFO::use_kv_ratio_compaction for a specific but important shape of workload: FIFO compaction, integrated BlobDB, large values, point lookups, and data that naturally expires by TTL or by a bounded data-size budget. The implementation was added in pull request #14326. The goal is to keep FIFO's low write amplification while reducing the read overhead caused by many small L0 files. The new picker uses the observed ratio between SST bytes and blob bytes to choose a stable target SST size, then moves L0 files through size tiers until they reach that target. Background: FIFO and BlobDB FIFO compaction is designed for time-ordered or log-like data. All files remain in L0. When files become old enough for ttl, or when the configured size limit is exceeded, RocksDB drops the oldest files instead of rewriting them into lower levels. That is what keeps FIFO write amplification low. Integrated BlobDB changes the file-size picture. Large values are stored in blob files, while SST files mostly contain keys, metadata, filters, indexes, and blob references. For point lookup workloads with large values, this can be a good fit: the SST portion can stay small and cached, and the read can fetch the large value from the blob file. However, FIFO without intra-L0 compaction can accumulate many small L0 SST files. A point lookup may then need to probe many L0 files and many filters before finding the key. FIFO's optional intra-L0 compaction, enabled with CompactionOptionsFIFO::allow_compaction, addresses that by merging several small L0 SST files into fewer larger SST files. Intra-L0 compaction rewrites SST metadata only; it does not rewrite blob files. Why the old intra-L0 picker is not enough The existing FIFO intra-L0 picker is cost based. It tries to reduce L0 file count while limiting how many bytes are rewritten for each file removed: 1 compact_bytes_per_del_file = total_input_bytes / (num_input_file