Joerg Hiller
Aug 25, 2026 18:09
Ray Data’s Shuffle V2 improves distributed processing with up to 53x faster joins and groupbys, addressing memory and recovery challenges.
Ray Data has introduced Shuffle V2, a reengineered shuffle engine designed to tackle scalability and performance bottlenecks in distributed data processing tasks like joins, groupbys, and repartitioning. According to the official announcement, the update enables up to 53x faster operations by leveraging the Ray object store to manage shuffle intermediates, rather than memory-intensive actor heaps.
The shuffle process, critical for operations such as deduplication and key-based joins, has historically been a pain point in distributed systems. The older Shuffle V1 implementation relied on long-lived aggregator actors, which introduced memory ceilings, recovery limitations, and resource inefficiencies. Shuffle V2 eliminates these constraints by redesigning the engine to split operations into map and reduce stages, with intermediate data stored in spillable, lineage-tracked shards within the object store. This architecture not only enhances reliability but also unlocks optimizations like vectorized aggregations and shard compression.
Why It Matters
Distributed workloads often fail when scaling to larger datasets due to out-of-memory (OOM) errors or inefficient resource allocation. For instance, Ray Data’s prior shuffle model required enough memory to hold the entire dataset in aggregator heaps, leading to frequent crashes for datasets exceeding 1 TB. By allowing intermediates to spill to disk and leveraging Ray Core’s lineage reconstruction, Shuffle V2 ensures stability and recoverability even under extreme data loads.
The performance gains are striking. In internal benchmarks using TPC-H datasets at scale, Shuffle V2 completed key joins in about 320 seconds, compared to Shuffle V1, which either timed out or required significantly more resources. For groupby operations, vectorized aggregations delivered over 30x performance improvements by offloading computation to Arrow’s native group-by capabilities.
Key Features and Optimizations
- Spillable State: Shuffle intermediates are stored as Ray objects that can spill to disk, eliminating memory constraints.
- Compression: Intermediate data is compressed using codecs like Zstd, reducing storage and transfer overhead. Zstd, for example, reduced spilled bytes by 91% and runtime by 26% in tests.
- Dynamic Resource Allocation: Unlike V1’s fixed aggregator pools, V2 dynamically allocates resources based on actual task requirements, improving cluster efficiency.
- Fusion and Vectorization: Downstream operations like groupby and map_batches are fused, skipping unnecessary intermediate writes. Aggregations now run as columnar operations, drastically reducing processing time.
Future Developments
Shuffle V2 is available starting with Ray 2.58, with further enhancements planned for Ray 2.59. Upcoming features include disk shuffle, which bypasses the object store entirely for even greater scalability, and support for incremental joins, which will reduce memory overhead for large-scale joins. Additionally, sort and random_shuffle functions, currently using older engines, will be migrated to the V2 architecture in future updates.
Takeaway for Users
For teams working with large-scale data pipelines—especially those involving joins, groupbys, or repartitioning—Shuffle V2 offers a significant performance boost and greater reliability. Users can enable the feature via the following configuration:
from ray.data.context import DataContext, ShuffleStrategy
DataContext.get_current().shuffle_strategy = ShuffleStrategy.HASH_SHUFFLE_V2
As distributed data workloads grow in size and complexity, tools like Ray Data Shuffle V2 are setting new benchmarks for what’s possible in scalable, fault-tolerant processing. With up to 53x performance improvements and a roadmap promising even more scalability, adopting Shuffle V2 could be a game-changer for data teams.
Image source: Shutterstock





Be the first to comment