Abstract
Big data applications have fast arriving data that must be quickly ingested. At the same time, they have specific needs to preprocess and transform the data before it could be put to use. The current practice is to do these preparatory transformations once the data is already ingested, however, this is expensive to run and cumbersome to manage. As a result, there is a need to push data preprocessing down to the ingestion itself. In this paper, we present a declarative data ingestion system, called INGESTBASE, to allow application developers to plan and specify their data ingestion logic in a more systematic manner. We introduce the notion of ingestions plans, analogous to query plans, and present a declarative ingestion language to help developers easily build sophisticated ingestion plans. INGESTBASE provides an extensible ingestion optimizer to rewrite and optimize ingestion plans by applying rules such as operator reordering and pipelining. Finally, the INGESTBASE runtime engine runs the optimized ingestion plan in a distributed and fault-tolerant manner. Later, at query processing time, INGESTBASE supports ingestion-aware data access and interfaces with upstream query processors, such as Hadoop MapReduce and Spark, to post-process the ingested data. We demonstrate through a number of experiments that INGESTBASE: (i) is flexible enough to express a variety of ingestion techniques, (ii) incurs a low ingestion overhead, (iii) provides efficient access to the ingested data, and (iv) has much better performance, up to 6 times, than preparing data as an afterthought, via a query processor.
Introduction
In modern big data pipelines, the standard practice is "ingest first, ask questions later." Raw data is typically dumped into a distributed file system like HDFS, followed by expensive "cooking jobs" (MapReduce or Spark tasks) to clean, partition, or reformat the data before it becomes useful for analysis.
This traditional approach suffers from three fundamental flaws. First, it is inefficient, requiring multiple passes over the data—reading raw, writing "cooked," and then reading "cooked" again for analysis. Second, it introduces management complexity; these ad-hoc scripts lack a formal language and often lead to uncontrolled data duplication. Finally, these post-ingestion jobs create resource contention, competing for the same compute clusters used for actual analytics during peak times. INGESTBASE proposes a shift: treating ingestion as a first-class, programmable step where data is transformed "as it flies" into the storage system.
System Architecture
INGESTBASE is designed as a comprehensive stack that sits between raw input data and upstream query processors. The system architecture consists of four primary layers that manage the lifecycle of data from arrival to optimized storage.
- Declarative Ingestion Language: Instead of writing complex scripts, developers use a SQL-like syntax to define Ingestion Plans. These specify filters, projections, partitioning, sorting, and serialization formats (e.g., RCFile or PAX).
- Ingestion Optimizer: Similar to a database query optimizer, this component applies rule-based transformations to the declarative plan. It can reorder operators to push filters down or pipeline operations to minimize disk I/O.
- Parallel Runtime Engine: This engine executes plans across a cluster, handling distributed heavy lifting like data shuffling, multi-threaded serialization, and fault tolerance via checkpointing.
- Ingestion-aware Data Access: This layer encodes transformation lineage (e.g., partitioning and sorting parameters) directly into filenames. This allows upstream engines like Spark or Hive to identify and leverage optimized data versions without a centralized metadata bottleneck.
Declarative Ingestion Plans
The core of the system is the Ingestion Plan, which represents a directed acyclic graph (DAG) of operators. By using a declarative approach, INGESTBASE can represent complex multi-stage pipelines that include replication, partitioning, and various storage layouts simultaneously.
A key insight of this approach is "piggy-backing" transformations. Many data preparation tasks are nearly "free" if performed while data is already in memory during the initial write. For example, checking data quality rules adds minimal CPU overhead compared to the massive I/O cost of re-reading the data for a separate cleaning job later.
Experimental Evaluation
The authors evaluated INGESTBASE using the TPC-H dataset at Scale Factor 1000 (~1TB of data). The evaluation covered four primary scenarios: data cleaning (functional dependency checks), data sampling (Bernoulli and reservoir), analytical layouts (PAX, RCFile), and storage optimization (flexible replication vs. erasure coding).
Key results include:
- Performance Gains: INGESTBASE was 6.1x faster than Hive for random sampling and 2.6x faster for data cleaning.
- Low Overhead: For operations like simple data cleaning, the overhead was only ~25% compared to a naive HDFS upload, whereas a separate cooking job would require over 100% overhead just to re-read the data.
- Query Speedup: By creating optimized layouts during ingestion, subsequent Spark/MapReduce queries achieved significant speedups by skipping irrelevant data blocks.
- Recovery Efficiency: The system's transformation-based recovery could reconstruct a missing 64MB data block in approximately 4 seconds.
Conclusion and Future Work
INGESTBASE demonstrates that moving data preparation to the ingestion phase significantly improves efficiency and simplifies data management. By using filenames as metadata signatures, the system avoids the "Small Files Problem" and central catalog overhead.
While the current implementation is optimized for HDFS, future work involves extending these principles to cloud-native object stores like S3, which present different challenges for consistency. Additionally, the authors aim to develop "storage optimizer tools" to automatically derive ingestion plans and adapt the model for sub-second latency requirements in true streaming ingestion environments like Kafka.
Summary updated