DistCache: Provable Load Balancing for Large-Scale Storage Systems with Distributed Caching

Zaoxing Liu, Zhihao Bai, Zhenming Liu, Xiaozhou Li, Changhoon Kim, Vladimir Braverman, Xin Jin, Ion Stoica

Abstract

DistCache is a distributed caching mechanism designed to provide provable load balancing for planetary-scale storage systems. By combining independent hashing across cache layers with "power-of-two-choices" routing, it enables cache throughput to scale linearly with the number of nodes while avoiding the significant overhead associated with traditional cache replication.

Introduction

Modern internet services rely on massive storage systems spanning thousands of servers. A primary challenge for these systems is workload skew, where a small fraction of data (the "hot objects") receives the vast majority of queries. While a single fast cache can balance the load for a small cluster, it becomes a bottleneck as the system scales out.

Existing solutions for scaling caches typically fall into two traps:

  1. Cache Partitioning: Splitting hot objects among cache nodes. This fails because a single "super-hot" object can still overwhelm the specific node it is assigned to.
  2. Cache Replication: Copying hot objects to every cache node. While this balances reads, it creates high overhead for writes, as every copy must be updated to maintain coherence.

DistCache aims to create a "one big cache" abstraction that scales linearly without these trade-offs.

Methods and Architecture

DistCache co-designs the cache's physical topology, data allocation, and query routing.

Multi-Layer Independent Hashing and Routing

Instead of a single hash function, DistCache utilizes independent hash functions for different layers of the cache (e.g., a leaf layer and a spine layer). An object is cached in exactly one node per layer. When a client accesses a hot object, it employs Power-of-Two-Choices (Po2C) Routing, checking the current load of the two possible cache locations and routing the query to the less-loaded node.

DistCache architecture using independent hashing and Power-of-Two-Choices routing to create a unified cache abstraction.

Theoretical Foundation

The authors use expander graphs and network flow theory to prove the system's stability. They demonstrate that a "perfect matching" always exists between objects and cache nodes, ensuring that there is always a way to distribute queries such that no node is overloaded. The simple, distributed Po2C algorithm effectively finds this balance in real-time.

Perfect matching in the bipartite graph between objects and cache nodes, ensuring stable load distribution.

Switch-Based Implementation

While the logic is general, the authors showcase DistCache using programmable switches (P4-based Barefoot Tofino). This allows the cache to operate at "line rate," processing packets as fast as the hardware can move them.

Key Results

The system was evaluated using synthetic workloads mimicking real-world traffic patterns, including Zipfian distributions and a key-value store with 100 million objects. Testing was conducted on a physical testbed with 6.5Tbps Barefoot Tofino switches.

  • Linear Scalability: In simulations of up to 4,096 storage nodes, DistCache's throughput increased linearly with the number of cache nodes.
  • Read/Write Efficiency: Under heavy skew (Zipf-0.99), DistCache maintained nearly 100% of the theoretical maximum throughput. In contrast, simple partitioning saw throughput drop by over 80% due to hotspots.
  • Low Overhead: The cache coherence protocol added minimal latency, allowing the system to handle write-heavy workloads where traditional replication-based caches would collapse.

Limitations and Future Work

Despite its efficiency, DistCache faces hardware constraints. Programmable switches have limited on-chip SRAM, capping the number of hot objects that can be stored in hardware. Additionally, the current prototype is optimized for small values (up to 128 bytes); handling larger objects like video would require integration with software-based caches or specialized hardware.

Summary updated

BibTeX
@inproceedings{liu2019distcache,
  author = {Zaoxing Liu and Zhihao Bai and Zhenming Liu and Xiaozhou Li and Changhoon Kim and Vladimir Braverman and Xin Jin and Ion Stoica},
  title = {{DistCache: Provable Load Balancing for Large-Scale Storage Systems with Distributed Caching}},
  booktitle = {FAST},
  year = {2019},
}
Figure