TL;DR
This paper introduces Starling, a novel query engine designed for cloud function services (like AWS Lambda) that offers interactive query performance at a lower cost than traditional provisioned systems, especially for ad-hoc analytical workloads. It achieves this by efficiently managing stateless workers, leveraging cloud object storage for data shuffling, and implementing novel techniques to mitigate stragglers and optimize for cost.
What Problem Does This Paper Address?
Modern organizations are increasingly moving their data analytics workloads to the cloud. While cloud providers offer elastic services, traditional cloud database analytics products often require users to provision and manage clusters of compute nodes. This leads to underutilization and wasted costs, especially for unpredictable or low-volume analytical workloads. Existing "elastic" features in these systems often take minutes to scale, making them impractical for per-query adjustments. Furthermore, many systems require data to be loaded into proprietary formats, adding latency. The authors identify a gap for a system that avoids pre-provisioning, charges per query, offers competitive performance, and allows users to tune cost and performance on a query-by-query basis. Cloud function services, with their fine granularity, low startup times, and pay-per-execution model, present a promising avenue, but come with challenges like managing many stateless workers, handling stragglers, and inter-worker communication.
Methods
Starling tackles these challenges by building a query execution engine on top of cloud function services. Key techniques include:
- Stateless Worker Management: Starling manages hundreds of tiny, stateless workers (cloud function invocations) to process queries.
- Cloud Object Storage for Shuffling: It leverages services like Amazon S3 for efficient and cost-effective shuffling of intermediate data between workers, a critical component for operations like joins and aggregations.
- Optimized Data Format: Intermediate results are materialized in a format optimized for cost and throughput in the pay-per-request model of cloud object storage.
- Straggler Mitigation: Starling employs tuned models to detect and mitigate the impact of "stragglers" (slow-running tasks) on query latency. This includes techniques like "doublewrite" for object visibility and retrying slow S3 requests.
- Tunable Performance and Cost: Users can optimize queries for cost or latency by adjusting parameters like the number of invocations at each stage.
- Pipelining: To reduce latency, Starling allows consuming stages to start processing data as soon as a significant fraction of producer inputs become available, rather than waiting for the entire stage to complete.
Datasets
The primary dataset used for evaluation is the TPC-H benchmark, specifically at scale factor 1,000 (1TB) and scale factor 10,000 (10TB). The data is stored in Apache ORC format, compressed with Snappy, and uploaded to Amazon S3. The authors exclude certain TPC-H queries (11, 21, 22) due to Starling's feature completeness or limitations of comparison systems.
Key Insights and Ideas
- Cloud Functions as a Viable Analytics Platform: The paper demonstrates that despite inherent limitations of cloud functions (e.g., execution time limits, statelessness), they can be effectively harnessed to build a competitive data analytics system.
- S3 as a Flexible Communication Medium: S3's cost-effectiveness and scalability make it a suitable, albeit higher-latency, alternative for inter-worker communication compared to more expensive or complex solutions.
- Straggler Mitigation is Crucial: The unpredictable nature of cloud services (especially S3) makes straggler mitigation essential for achieving consistent and competitive query performance. The "doublewrite" and read/write retry mechanisms are key to this.
- Cost-Performance Trade-offs are User-Tunable: Starling's design allows users to explicitly balance query cost against performance by adjusting parameters like task parallelism, offering flexibility for ad-hoc workloads.
- Serverless Can Be Cheaper for Infrequent Workloads: For moderate query volumes, Starling's pay-per-query model offers significant cost advantages over provisioned systems that incur fixed costs regardless of usage.
Key Results
- Cost-Effectiveness: Starling is less expensive than provisioned systems (like Redshift) for workloads with moderate query volumes (e.g., less than 60 queries per hour for local data, less than 30-120 queries per hour for S3-based data).
- Performance: Starling achieves query latency comparable to provisioned systems, especially for ad-hoc workloads. For the 10TB dataset, Starling's query latency was at least 2.7 times lower than provisioned systems.
- Scalability: Starling scales to larger datasets (up to 10TB) without requiring expensive reprovisioning steps, demonstrating its elastic nature.
- Straggler Mitigation Impact: Read straggler mitigation (RSM) significantly reduces tail latency for S3 reads, cutting 99.99th percentile latency from over a second to 0.25 seconds. Write straggler mitigation (WSM) also improves tail latency for writes.
- Tunable Performance: For TPC-H Query 12, Starling's latency can be improved by a factor of six by enabling optimizations incrementally, with doublewrite providing the most significant improvement.
Limitations and Future Work
- No Query Optimizer: Starling currently relies on pre-planned queries and does not have its own query optimizer. This means users must provide optimal join orders, potentially by using external optimizers like Redshift's.
- Coordinator Bottleneck: For very high concurrency, the low-cost coordinator can become a bottleneck.
- Straggler Mitigation Assumptions: The straggler mitigation models are based on observed latency and throughput, and their effectiveness might depend on the underlying cloud provider's infrastructure.
- Future Work: The authors suggest optimizing the coordinator for high concurrency and exploring more sophisticated query optimization techniques within Starling. They also note that further investigation into the cost-effectiveness for cloud providers is warranted.
Summary updated