Abstract
This paper introduces Ephemeral Per-query Engines (EPQE), a paradigm shift in serverless data processing where a dedicated engine is dynamically instantiated for a single query and discarded immediately upon completion. By leveraging Functions-as-a-Service (FaaS) and a specialized networking layer called Boxer, the authors demonstrate that running unmodified distributed engines like Apache Drill on AWS Lambda is not only feasible but often outperforms traditional container-based serverless solutions in both speed and cost-efficiency.
Introduction
Traditional big data analytics rely on persistent clusters (e.g., Spark or Drill running on virtual machines). This model is plagued by three primary inefficiencies: idle costs during periods of inactivity, rigid scaling that fails to match bursty workloads, and suboptimal configurations that cannot be tailored to specific query requirements. While "Query-as-a-Service" platforms like AWS Athena offer pay-per-use economics, they operate as "black boxes," preventing users from utilizing custom engines or fine-tuning resource allocations.
EPQE addresses these issues by treating the query engine as a transient resource. This approach provides the flexibility of custom engine selection with the granular billing of serverless computing.
The MetaQ Architecture
To implement the EPQE model, the authors developed MetaQ, a prototype system designed to manage the lifecycle of ephemeral engines. The architecture consists of three core components:
- Session Manager (SM): Orchestrates the end-to-end lifecycle of a query.
- Meta-system Optimizer (MO): Analyzes queries to determine the optimal engine (e.g., Spark vs. Drill) and resource allocation (CPU/RAM).
- Platform Provider (PP): Manages the deployment and scaling of workers on the FaaS platform.
A significant challenge in running unmodified distributed engines on FaaS is the lack of standard networking. MetaQ overcomes this using Boxer, a compatibility layer that provides a POSIX-compliant networking environment. This allows serverless functions to communicate as if they were nodes in a standard cluster.
Experimental Evaluation
The system was evaluated using the TPC-H benchmark (Scale Factors 10 and 30) on AWS Lambda with an unmodified 8-worker Apache Drill setup. The results revealed a compelling advantage for the serverless model: AWS Lambda's rapid cold starts allow MetaQ to complete many queries before a container-based service like AWS Fargate even finishes its environment initialization.
As shown in the evaluation, median end-to-end execution times ranged from 30.4s to 65.1s. For nearly every query tested, the total time to instantiate the engine and execute the query was less than the 54.9-second initialization threshold required by AWS Fargate/ECS. Furthermore, because FaaS bills at millisecond granularity, MetaQ avoids the minimum billing periods (often one minute) associated with container services, significantly reducing costs for interactive workloads.
Discussion and Future Work
While the EPQE model shows great promise, the researchers identified areas for improvement. Startup overhead currently accounts for 30% to 67% of total execution time. While competitive, this could be further reduced using technologies like AWS Lambda SnapStart. Additionally, there is inherent variance in FaaS startup times; some "straggler" instances can take significantly longer than the median, a challenge the authors propose mitigating through worker over-provisioning.
Future work will focus on automating the Meta-system Optimizer's logic to select engines without human intervention and improving state management for data shuffling, which currently relies on Amazon S3 as a bottleneck.
Summary updated