XLL: Cross-Layer Logging for Data Deduplication in Consensus-Based Storage

John Shawger (University of Wisconsin – Madison), Arnav Jhingran (University of Wisconsin – Madison), Andrea Arpaci-Dusseau (University of Wisconsin – Madison), Remzi Arpaci-Dusseau (University of Wisconsin – Madison)

23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26) · Day 3 · Distributed Data Systems

Overview

System designers frequently rely on clean abstractions to build modular, maintainable software, but these architectural boundaries often carry hidden performance and resource costs. In consensus-based distributed storage systems—such as those powering modern cloud-scale key-value stores—a pervasive multi-layer design pattern leads to cross-layer data duplication. Developers typically layer a consensus protocol (like Raft or Paxos) on top of a persistent, crash-consistent local storage engine (such as RocksDB). While this separation of concerns simplifies development, it forces the underlying storage stack to write the exact same data payload multiple times: once into the consensus log for ordering and replication, and again into the local storage layer when applying committed commands.

Watch on YouTube · Slides

Visual summary for XLL: Cross-Layer Logging for Data Deduplication in Consensus-Based Storage by John Shawger, Arnav Jhingran, Andrea Arpaci-Dusseau, Remzi Arpaci-Dusseau
Visual summary for XLL: Cross-Layer Logging for Data Deduplication in Consensus-Based Storage by John Shawger, Arnav Jhingran, Andrea Arpaci-Dusseau, Remzi Arpaci-Dusseau

Key moments

  1. 0:00 Introduction and cross-layer data duplication problem
  2. 2:08 Talk overview and TiKV architecture basics
  3. 3:58 Proposed solution: Cross-layer log and key-value separation
  4. 6:24 Practical design: Efficient read algorithm using Protobuf
  5. 8:20 Managing crash recovery without write-ahead logging
  6. 9:59 Evaluation methodology and test setup
  7. 11:39 Write amplification results and YCSB workload performance
  8. 13:59 Conclusion and final takeaways on data isolation

XLL: Cross-Layer Logging for Data Deduplication in Consensus-Based Storage

Speakers: John Shawger (University of Wisconsin – Madison); Arnav Jhingran (University of Wisconsin – Madison); Andrea Arpaci-Dusseau (University of Wisconsin – Madison); Remzi Arpaci-Dusseau (University of Wisconsin – Madison)

Conference: USENIX NSDI

YouTube: https://www.youtube.com/watch?v=9zfjSbzmb3I

Overview

System designers frequently rely on clean abstractions to build modular, maintainable software, but these architectural boundaries often carry hidden performance and resource costs. In consensus-based distributed storage systems—such as those powering modern cloud-scale key-value stores—a pervasive multi-layer design pattern leads to cross-layer data duplication. Developers typically layer a consensus protocol (like Raft or Paxos) on top of a persistent, crash-consistent local storage engine (such as RocksDB). While this separation of concerns simplifies development, it forces the underlying storage stack to write the exact same data payload multiple times: once into the consensus log for ordering and replication, and again into the local storage layer when applying committed commands.

This talk, presented at USENIX NSDI, investigates this architectural inefficiency across widely deployed distributed databases, including TiKV, CockroachDB, etcd, Spanner, and Cassandra. To eliminate this redundancy without sacrificing persistence, crash consistency, or read performance, the researchers introduce XL (Cross-Layer), a shared append-only logging library, and its integration into TiKV XL. By rethinking data organization and merging consensus logs with local storage logs, the authors demonstrate dramatic performance improvements—achieving up to 5.5× higher throughput on write-heavy workloads and a 73% reduction in write amplification.

The core thesis challenges the orthodox view of strict layer isolation in systems design. By showing that cross-layer coordination can be implemented cleanly and efficiently, this work provides a blueprint for systems engineers seeking to maximize hardware utilization in distributed storage environments. The implications extend across infrastructure teams building high-throughput transactional databases, replicated state machine engines, and large-scale cloud storage primitives.

Background

▶ Watch: Introduction and cross-layer data duplication problem (0:00)

The architectural tension between consensus protocols and local storage engines stems from independent reliability requirements. When building a replicated key-value service, engineers frequently start with a local persistent engine like RocksDB, which uses Log-Structured Merge-tree (LSM-tree) architectures to manage on-disk data. To scale this service across a cluster and guarantee fault tolerance, a replication layer is added above the storage engine.

In a standard Raft-based system, a client write triggers a multi-step persistence pipeline. First, the leader node appends the put command to its local consensus log. Once a quorum of followers acknowledges the entry, the command is committed and subsequently handed down to the local storage engine, where it is written a second time. A microscopic examination of this flow within systems like TiKV reveals an even starker reality. TiKV organizes its storage into two separate LSM-trees: a Raft LSM-tree (complete with its own Write-Ahead Log (WAL) and memtables) and a Key-Value LSM-tree (also with its own WAL and SSTables). Consequently, a single logical value $V$ can trigger up to four physical disk writes: two WAL entries and two SSTable writes.

Prior systems have attempted to mitigate localized write overhead through key-value separation techniques—exemplified by storage engines like Whiskey, BadgerDB, and Titan. These systems decouple large values from the LSM-tree, storing them in separate, append-only on-disk log files while keeping only lightweight byte offsets (references) inside the LSM-tree. While this design eliminates traditional WALs by treating the value log as a WAL substitute, it fails to solve the broader cross-layer duplication problem. The consensus layer still maintains its own independent log containing the payload, resulting in the data being written twice across the system boundaries. XLL directly addresses this fundamental systems bottleneck by unifying the consensus log and the storage value log into a single cross-layer entity.

Key Findings

▶ Watch: Proposed solution: Cross-layer log and key-value separation (3:58)

The evaluation of TiKV XL against standard distributed architectures yields several major discoveries regarding throughput, write amplification, and latency:

  • Dramatic Write Amplification Reduction: Random write amplification is slashed to just 1% to 2% overhead (a 73% reduction compared to baseline TiKV), approaching optimal bounds. In contrast, dual-LSM architectures like baseline TiKV and CockroachDB exhibit 3× to 4× write amplification even on small datasets (4 GB), driven by redundant WAL and SSTable writes.
  • Substantial Throughput Gains: On write-heavy YCSB benchmarks (Workloads A and F), TiKV XL achieves up to 5.5× higher throughput than standard TiKV, outperforming separation-only designs (XLSO) by cleanly removing redundant writes.
  • Latency Improvements at the Tail: Median commit latencies improve due to more efficient disk operations, while apply phase latencies become nearly instantaneous—even at extreme tail distributions ($p_{99}$ and higher)—because the system avoids issuing an extra disk write during the apply phase.
  • Preserved Read Performance: Despite eliminating value duplication and shifting to a reference-based lookup model, TiKV XL matches the read performance of traditional separation-only architectures, confirming that its optimized read path introduces negligible overhead.

Technical Deep Dive

▶ Watch: Managing crash recovery without write-ahead logging (8:20)

The architectural core of XL relies on merging the consensus log and the storage value log into a unified Cross-Layer Log. When a client issues a put command, the leader appends the entry solely to this cross-layer log. Instead of executing a second physical write during the apply phase, the key-value LSM-tree stores a compact locator pointing directly to the byte offset and length of the value embedded within the existing consensus log entry.

This design introduces two major technical hurdles: efficient random access to serialized wire formats and robust crash recovery without traditional WALs.

Efficient Read Algorithms for Wire Formats

Distributed systems rely heavily on Protocol Buffers (Protobufs) for wire-format serialization. A typical Raft entry consists of a fixed-size header followed by a sequence of protobuf-encoded commands containing keys and values. Because protobufs use variable-width integers (varints) to encode field lengths, they are optimized for sequential transfer rather than random access.

The naive approach to reading a specific value from a log entry requires deserializing the entire protobuf buffer. To avoid this overhead, the authors modify the Protobuf Compiler code generation pipeline. For every protobuf type, the compiler generates a C++ struct with accessor methods alongside a specialized get_offset() method for each field.

When the system parses a Raft entry during normal execution, it simultaneously populates the struct and invokes get_offset() to determine the exact byte offset and length of the target value (e.g., discovering that value V1 begins at byte offset 60 within a Raft entry stored at log byte offset 10,000, with a length of 4096 bytes). The key-value LSM tree then stores a locator containing this combined location pair (10000 + 60, length 4096). Subsequent reads fetch the value directly from the log using a single pre-read operation.

Crash Recovery Protocol

Because TiKV XL removes traditional WALs from the key-value storage layer, key-value data in the LSM-tree memtables is only memory-durable between flushes. To guarantee crash consistency, the system maintains minimal persistent state metadata on disk:

  1. Raft Side: A tail pointer indicating the end of the last persisted entry in the cross-layer log.
  2. Key-Value Side: The last applied index, tracking the final applied log entry.

Following a system crash and memory loss, recovery proceeds in two distinct phases:

  • Phase 1 (Raft Log Replay): The system replays the cross-layer log starting from the persistent tail pointer to the end of the log, restoring all Raft entries back into memory.
  • Phase 2 (Controlled Reapplication): Starting from the recorded last applied index (preventing double-application), the system re-applies commands from the remaining Raft log entries to rebuild the key-value LSM-tree memory structures.

Experimental Setup & Results

▶ Watch: Evaluation methodology and test setup (9:59)

The evaluation utilizes a dedicated 3-node Raft cluster equipped with high-speed NVMe storage devices and a 100-gigabit network interconnect. The authors benchmark three distinct storage configurations:

  • TiKV: The standard baseline system featuring dual LSM-trees and independent WALs.
  • XLSO (XL Separation Only): An intermediate architecture implementing key-value separation with two separate on-disk logs, but lacking cross-layer deduplication.
  • TiKV XL: The fully integrated research system combining cross-layer logging and data deduplication.

Headline Results & Metrics

  • End-to-End Latency CDFs: Measured on 16 KB write operations, TiKV XL demonstrates substantial reductions in commit latency due to streamlined disk writes. The apply phase latency distribution collapses near zero, eliminating the long-tail latency spikes characteristic of baseline TiKV's redundant write amplification.
  • Write Amplification Factor (WAF): Evaluated under small database loads (4 GB, ignoring background compaction), TiKV and CockroachDB register WAFs between 3.0 and 4.0. XLSO and etcd achieve WAFs around 2.0 to 3.0. TiKV XL achieves a near-optimal WAF of 1.01 to 1.02, representing a 73% reduction relative to baseline TiKV.
  • YCSB Workloads: Across diverse read/write mixes, TiKV XL dominates write-heavy profiles. On YCSB Workloads A and F, TiKV XL delivers up to 5.5× higher throughput than baseline TiKV while maintaining a decisive performance margin over the separation-only (XLSO) system. On read-heavy workloads, TiKV XL matches the performance of XLSO, verifying that the custom offset-based read path introduces zero performance regression.

Practical Implications

▶ Watch: Conclusion and final takeaways on data isolation (13:59)

For infrastructure teams, database architects, and systems engineers deploying large-scale distributed storage, this research offers a compelling roadmap for eliminating structural inefficiencies.

  • Challenging Strict Layer Isolation: The findings demonstrate that rigid architectural boundaries—while convenient for software engineering—can impose severe I/O penalties on high-performance storage engines. Engineers should carefully evaluate whether cross-layer optimizations can safely bypass redundant persistence layers.
  • Adopting Protocol Buffer Optimizations: The code-generation strategy for random access within serialized protobuf payloads provides a reusable pattern for systems engineers handling wire-format logs without incurring full deserialization overhead.
  • Tradeoffs and Limitations: While TiKV XL dramatically reduces write amplification and increases throughput, eliminating lower-layer WALs requires careful management of crash recovery protocols and metadata synchronization (such as tracking tail pointers and last applied indices). Implementers must ensure that custom log parsing and garbage collection mechanisms for shared append-only logs do not introduce undue code complexity or maintenance burdens in production environments.

Key Takeaways

  • Pervasive Redundancy: Consensus-based distributed key-value stores routinely suffer from cross-layer data duplication, writing the same data payload multiple times across consensus logs and local storage layers.
  • Unified Cross-Layer Logging: Merging the consensus log and the storage value log into a single XL log eliminates redundant physical writes while preserving crash consistency and persistence semantics.
  • Optimized Wire-Format Parsing: By extending the Protobuf Compiler to generate field-level byte offset accessors, systems can achieve efficient random access to serialized log entries without full deserialization.
  • Near-Optimal Write Amplification: TiKV XL reduces random write amplification to 1%–2% overhead (a 73% reduction compared to baseline TiKV).
  • Substantial Throughput Gains: The system delivers up to 5.5× higher throughput on write-heavy YCSB workloads (Workloads A and F) while maintaining parity on read-heavy workloads.

About the Speaker(s)

The research was presented by members of the systems research group at the University of Wisconsin – Madison, led by John Shawger, Arnav Jhingran, Andrea Arpaci-Dusseau, and Remzi Arpaci-Dusseau. The team has a long-standing track record of influential research in operating systems, storage systems, file systems, and crash consistency in modern NVMe and distributed environments.

Reviews

→ Top-rated talks at 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)

All talks from 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)