DiNoDB: An Interactive-Speed Query Engine for Ad-Hoc Queries on Temporary Data

Yongchao Tian, Ioannis Alagiannis, Erietta Liarou, Anastasia Ailamaki, Pietro Michiardi, Marko Vukolic

TL;DR

DiNoDB is a distributed query engine designed to eliminate the "data loading tax" for short-lived, exploratory data analysis. By "piggybacking" metadata creation onto existing batch processing jobs, it enables interactive-speed SQL queries directly on raw data files without the need for expensive ingestion or format conversion.

What Problem Does This Paper Address?

In modern "Lambda Architectures," data typically flows through three layers: batch (Hadoop/Spark), speed (streaming), and serving (Hive/Impala). The bottleneck for data scientists often lies in the serving layer. To get high performance, current systems require "loading" data—converting raw text files (CSV/JSON) into optimized columnar formats like Parquet or ORC and building indexes.

This is fine for production workloads, but it’s a dealbreaker for temporary data. When a researcher is tuning a machine learning model or exploring a new dataset, the data is often "ephemeral"—it might only be useful for a few hours or a handful of queries. In these cases, the time spent loading and formatting the data can actually exceed the time spent querying it. The authors call this the "data-to-insight" gap.

Methods

DiNoDB bridges this gap by implementing a distributed version of the NoDB (No Database) paradigm. Its core innovation is the I/O Decorator.

Standard batch jobs (like a MapReduce or Spark job) spend a significant amount of time writing output to the Hadoop Distributed File System (HDFS). DiNoDB intercepts this write process. As the batch job writes its final results, DiNoDB’s decorators simultaneously scan the data to create:

  • Positional Maps: These store the byte offsets of specific attributes within a row, allowing the query engine to "jump" directly to a column without parsing the entire line.
  • Vertical Indexes: Lightweight key-value maps that link specific attribute values to their row offsets for fast lookups.
  • Statistics: Cardinality estimates (using the HyperLogLog algorithm) to help the query optimizer choose the best execution plan.

Because this happens during the idle CPU cycles of an I/O-bound write operation, the overhead is nearly zero. The resulting metadata is stored alongside the raw files, allowing the DiNoDB query engine (built on an optimized version of PostgreSQL called PostgresRaw) to execute parallel SQL queries directly on HDFS.

Datasets

The researchers evaluated DiNoDB using three primary datasets:

  1. Synthetic Dataset: A 70 GB dataset with 150 attributes used to stress-test positional maps and scalability.
  2. Symantec Email Dataset: 40 GB of real-world spam data in JSON format (approx. 55 million records) used for a machine learning topic modeling use case.
  3. Ubuntu One Logs: A 773 GB trace of server logs in CSV format (137 million unique files) used to simulate a large-scale data exploration scenario.

Key Insights and Ideas

  • The "Piggyback" Strategy: The most elegant insight is that the "cost" of indexing can be hidden within the "cost" of writing. By generating metadata while the data is being "cleansed" or produced by a batch job, the serving layer is ready for queries the moment the batch job finishes.
  • Selective Parsing: Unlike traditional RDBMS that parse every field during a scan, DiNoDB uses its positional maps to perform "selective parsing." It only converts the specific bytes needed for a query into binary format, drastically reducing CPU usage.
  • The Break-Even Point: The paper quantifies exactly when "loading" becomes a waste of time. For their test cases, DiNoDB remained the faster choice for up to 100 queries. If you plan to run more than 100 queries on the same data, the upfront cost of converting to a format like Parquet finally starts to pay off.

Key Results

  • Query Speed: For random ad-hoc queries, DiNoDB was 3x faster than the next best system (Impala) that executed directly on raw files.
  • Indexing Power: When queries hit a column that was indexed via the vertical index decorator, DiNoDB was 10x faster than systems like Hive or SparkSQL.
  • Negligible Overhead: In the machine learning use case, adding DiNoDB decorators to a 5-hour Mahout job added only 16 seconds of overhead (a 0.45% increase).
  • Scalability: DiNoDB showed near-constant query performance as the number of attributes in the dataset increased, whereas competitors like Impala scaled linearly (getting slower as the rows got wider).

Limitations and Future Work

While DiNoDB excels at raw text, the current prototype is a research vehicle. It lacks some of the advanced query optimization features found in mature products like Impala (e.g., Just-In-Time compilation).

The authors also note that their current replication strategy for metadata is tied to HDFS's default behavior, which can sometimes lead to data/metadata misalignment. Future work involves creating a more robust "container" format (similar to Parquet but for raw data + metadata) to ensure better fault tolerance and data locality. Finally, while the paper focuses on text, the authors suggest the "decorator" approach could eventually be extended to binary formats.

Summary updated

BibTeX
@article{tian2017dinodb,
  author = {Yongchao Tian and Ioannis Alagiannis and Erietta Liarou and Anastasia Ailamaki and Pietro Michiardi and Marko Vukolic},
  title = {{DiNoDB: An Interactive-Speed Query Engine for Ad-Hoc Queries on Temporary Data}},
  journal = {IEEE Trans. Big Data},
  year = {2017},
  doi = {10.1109/tbdata.2016.2637356},
}
Figure