Lachesis: Automated Generation of Persistent Partitionings for Big Data Applications

Jia Zou, Pratik Barhate, Amitabh Das, Arun Iyengar, Binhang Yuan, Dimitrije Jankov, Chris Jermaine

Abstract

Persistent partitioning is effective in avoiding expensive shuffling operations. However, it remains a significant challenge to automate this process for Big Data analytics workloads that extensively use user-defined functions (UDFs), where sub-computations are hard to be reused for partitionings compared to relational applications. In addition, functional dependency that is widely utilized for partitioning selection is often unavailable in the unstructured data that is ubiquitous in UDF-centric analytics. We propose the Lachesis system, which represents UDF-centric workloads as workflows of analyzable and reusable sub-computations. Lachesis further adopts a deep reinforcement learning model to infer which sub-computations should be used to partition the underlying data. This analysis is then applied to automatically optimize the storage of the data across applications to improve the performance and users' productivity.

Introduction

In traditional relational database management systems (RDBMS), partitioning data across a cluster is a well-understood optimization. The system leverages schema information and relational algebra to minimize data "shuffling"—the costly movement of data across a network during joins or aggregations. However, modern Big Data frameworks like Apache Spark and Apache Flink often process unstructured data using complex User-Defined Functions (UDFs) written in languages like Java or Python.

To a standard execution engine, these UDFs are "opaque" black boxes. The optimizer cannot see the logic inside the code, making it nearly impossible to automatically determine the best partitioning strategy. Consequently, developers must manually tune these settings, a process that is both error-prone and labor-intensive. Lachesis addresses this by making UDFs transparent and using machine learning to automate partitioning decisions.

The Lachesis Architecture

Lachesis introduces a three-stage pipeline to automate partitioning for UDF-centric workloads: Candidate Enumeration, Candidate Selection, and Partitioner Matching.

Comparison of relational and UDF-centric partitioning workflows in Lachesis.

Unlike relational systems that rely on foreign key analysis and manual cost estimation, Lachesis analyzes historical Intermediate Representation (IR) graphs of UDF workflows. It uses Deep Reinforcement Learning (DRL) to select the optimal partitioning candidate without needing a complex, manually-tuned cost model.

1. Intermediate Representation (IR) Graphs

The first pillar of Lachesis is converting UDF code into analyzable directed acyclic graphs (DAGs). This allows the system to identify data parsing, transformation, and join points. By abstracting these as "two-terminal graphs," Lachesis can treat code-analysis as a manageable subgraph matching problem.

An IR graph and its corresponding UDF code for extracting a partition key from JSON data.

As shown above, Lachesis can derive a partition key directly from the logic of a UDF (e.g., extracting an "author" or "subreddit" field from a JSON comment). This allows the system to pre-partition data based on how it will actually be used in future computations, effectively "cracking open" the black box.

2. Deep Reinforcement Learning (DRL) for Selection

Because distributed environments involve complex variables like network latency and serialization overhead, traditional mathematical cost models often fail. Lachesis employs an Actor-Critic (A3C) DRL model. The model treats partitioning as a game where the objective is to minimize latency. It learns to favor partitioning keys based on features like frequency of use, data size, and key distribution, adapting to the specific hardware and software environment.

Evaluation and Results

The researchers evaluated Lachesis across several benchmarks, including real-world Reddit data integration, refactored TPC-H workloads, and PageRank graph analytics.

Key results include:

  • Significant Speedups: Lachesis achieved a 6.5x speedup on PageRank compared to standard round-robin partitioning and a 2.4x speedup on the Reddit workload by identifying optimal UDF-based join keys.
  • Handling Relational Logic: Even when handling traditional relational logic hidden inside UDFs (TPC-H), Lachesis outperformed standard advisors by 6% to 12%.
  • Low Overhead: Offline analysis of millions of tasks took less than 15 minutes, while online decision-making latency remained under one second.

Conclusion

Lachesis demonstrates that UDFs are not truly "black boxes" if they are translated into structured IR graphs. By combining this transparency with the adaptive power of Deep Reinforcement Learning, Lachesis automates a critical performance bottleneck in Big Data analytics, improving both system performance and developer productivity.

Summary updated

BibTeX
@misc{zou2020lachesis,
  author = {Jia Zou and Pratik Barhate and Amitabh Das and Arun Iyengar and Binhang Yuan and Dimitrije Jankov and Chris Jermaine},
  title = {{Lachesis: Automated Generation of Persistent Partitionings for Big Data Applications}},
  year = {2020},
  eprint = {2006.16529},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.16529},
}
Figure