Stocator: a high performance object store connector for spark

Gil Vernik, Michael Factor, Elliot K. Kolodner, Effi Ofer, Pietro Michiardi, Francesco Pace

Abstract

Apache Spark's reliance on traditional file system semantics, specifically atomic rename operations, creates a significant performance mismatch when deployed on cloud object storage. This paper introduces Stocator, a specialized storage connector that optimizes Spark's interaction with object stores like Amazon S3 and IBM Cloud Object Storage. By abandoning the simulation of hierarchical file systems and leveraging native object store semantics, Stocator achieves up to 18x faster writes and reduces REST API calls by up to 30x, leading to substantial reductions in both execution time and operational costs.

Introduction

Apache Spark was originally architected for the Hadoop Distributed File System (HDFS), where renaming a file is a near-instant, atomic operation. Spark utilizes this capability to manage speculative execution: it writes task outputs to temporary files and renames the successful attempt's output to the final destination.

However, cloud object stores are fundamentally key-value stores rather than true file systems. They do not support a native "rename" operation. To simulate one, connectors must perform a COPY followed by a DELETE, a process that is slow, expensive, and non-atomic. Furthermore, the eventual consistency models of many object stores can lead to data loss or job failures during these simulated rename phases. Existing solutions often require external databases to track consistency, adding complexity and cost.

Architecture and Methodology

Stocator addresses these challenges by moving away from the "temporary file + rename" paradigm. Instead of trying to make an object store act like a POSIX file system, Stocator embraces its native semantics.

The architectural shift from legacy Hadoop connectors to the unified Stocator approach.

The Stocator Algorithm

The core of Stocator is an algorithm designed for direct object manipulation:

  • Direct Writes: Output objects are written directly to their final destination names. To handle speculative execution without interference, Stocator embeds an "attempt number" into the object name (e.g., part-0000-attempt-1).
  • Manifest-based Success: Completion is signaled by writing a _SUCCESS object that serves as a manifest. This manifest explicitly lists the specific attempts that constitute the valid dataset, ensuring consistency even in eventually consistent environments.
  • Streaming Data: By utilizing HTTP Chunked Transfer Encoding, Stocator streams data directly to the object store as it is generated, eliminating the need for large local disk buffers.
  • Metadata Optimization: The connector caches metadata checks and removes redundant directory-style operations that are unnecessary in a flat object namespace.

Experimental Evaluation

The authors evaluated Stocator using a variety of benchmarks, including micro-benchmarks (Teragen, Terasort) and macro-benchmarks like TPC-DS and Wordcount.

Key Results

  • Write Performance: In write-intensive workloads like Teragen, Stocator demonstrated performance up to 18 times faster than standard Hadoop-Swift connectors.
  • Operational Efficiency: Stocator significantly reduces the overhead of interacting with cloud APIs. As shown in the comparison of REST operations, Stocator eliminates the need for the costly COPY/DELETE cycles associated with task and job commits.
Comparison of REST operations between the standard Hadoop MapReduce client and Stocator, highlighting the elimination of redundant calls.
  • Cost Reduction: Because cloud providers charge per REST operation, the reduction in API calls translates directly to cost savings. Stocator was found to be 16 to 18 times less expensive in terms of REST API charges compared to the S3a connector.

Conclusion and Future Work

Stocator demonstrates that performance and consistency in the cloud are best achieved by aligning software abstractions with the underlying storage semantics. By treating object stores as key-value stores rather than file systems, Stocator provides a high-performance, cost-effective solution for Spark workloads. Future work includes expanding support to other Hadoop ecosystem components like Hive and MapReduce, and further reducing initial metadata startup latency. Stocator is currently open-source and has been integrated into production environments at IBM.

Summary updated

BibTeX
@inproceedings{vernik2017stocator,
  author = {Gil Vernik and Michael Factor and Elliot K. Kolodner and Effi Ofer and Pietro Michiardi and Francesco Pace},
  title = {{Stocator: a high performance object store connector for spark}},
  booktitle = {SYSTOR},
  year = {2017},
  doi = {10.1145/3078468.3078496},
}
Figure