Optimizing Dataflow Systems for Scalable Interactive Visualization

Junran Yang, Hyekang Kevin Joo, Sai S. Yerramreddy, Dominik Moritz, Leilani Battle

TL;DR

This paper introduces VegaPlus, a system that automatically optimizes interactive visualizations for large datasets by intelligently offloading computation to a backend database. It tackles the challenge of bridging the gap between visualization design and efficient data processing, enabling smoother and faster interactive exploration.

What Problem Does This Paper Address?

Interactive data visualization is crucial for understanding large datasets, but traditional approaches often treat visualization design and data management optimization as separate, complex tasks. Visualization languages like Vega are powerful for creating diverse interactive graphics but struggle with performance on large datasets, often falling behind basic database systems. This disconnect requires users to possess expertise in both visualization and data management, a rare combination. The paper aims to automate this optimization process, allowing analysts to focus on design while ensuring scalability and responsiveness.

Methods

VegaPlus introduces a novel approach to optimize Vega visualizations by integrating with backend databases (like PostgreSQL or DuckDB). The core innovation lies in an optimizer that intelligently partitions the dataflow graph of a Vega specification. It achieves this through:

  • Query Rewriting: Vega transforms (e.g., filtering, aggregation) are automatically translated into SQL queries. These rewritten operations are then encapsulated in custom VegaDBMSTransform (VDT) operators.
  • Plan Enumeration: For a given Vega specification, VegaPlus enumerates a set of candidate execution plans that represent different ways to distribute the computation between the client-side Vega runtime and the server-side DBMS.
  • Pairwise Comparison Models: Instead of predicting absolute execution times, VegaPlus uses machine learning models (RankSVM, Random Forest, and a heuristic model) to compare pairs of execution plans and determine which is more efficient. This "learning-to-rank" approach is more robust for plan selection.
  • Interaction-Aware Optimization: The system considers how user interactions can alter the dataflow and dynamically re-evaluates and optimizes plans to maintain performance.
  • Caching: A two-level caching scheme (client-side and middleware) is employed to store and reuse query results, further reducing latency.

Datasets

The paper introduces a Vega benchmark suite for evaluation. This suite consists of:

  • Five real-world datasets scaled to various sizes (50,000 to 1 million rows).
  • Seven Vega templates representing common visualization designs (e.g., Trellis Stacked Bar Chart, Line/Area Chart, Interactive Histogram, Zoomable Heatmap, Crossfiltering with Three 2D Histograms, Heatmap and Bar Chart, Overview+Detail Chart With Bar Chart). These templates are independent of the datasets, allowing for flexible pairings.

Key Insights and Ideas

  • Bridging the Visualization-Data Gap: The core idea of automatically optimizing visualization dataflows by leveraging database capabilities is a significant step towards making large-scale interactive visualization accessible to a wider audience.
  • Pairwise Comparison is Key: The finding that pairwise comparison models (learning to rank plans) are more effective than pointwise models (predicting absolute cost) for plan selection in this context is crucial. It highlights that avoiding slow plans is as important as finding fast ones.
  • Heuristics Can Be Powerful: The heuristic model, despite lower accuracy in pairwise comparison, achieved competitive performance. This suggests that well-designed heuristics derived from ML insights can offer a good balance of performance and interpretability.
  • Interaction Complexity: Optimizing for interactive sessions is significantly more complex than for static dashboards due to the dynamic nature of queries and dataflow changes.

Key Results

  • Performance Improvement: VegaPlus demonstrates significant performance improvements over the base Vega library, achieving up to an 86% speedup for interactive templates with 1 million data points.
  • Scalability: VegaPlus scales better than Vega as the data size increases.
  • Model Performance: The Random Forest model showed the highest accuracy in pairwise prediction. However, the heuristic model and RankSVM achieved comparable or better end-to-end performance, often selecting plans that were close to optimal.
  • Interaction Session Performance: For interaction sessions, VegaPlus with the RankSVM comparator model showed comparable end-to-end execution time to VegaFusion, and significantly better than Vega, especially with smaller datasets.

Limitations and Future Work

  • Enumeration Overhead: While manageable for most templates, the plan enumeration space can become prohibitively large for highly complex visualizations. The authors suggest pruning strategies (e.g., based on estimated cardinality) to address this.
  • Interaction Parameter Sensitivity: The performance of interaction-aware optimization can be sensitive to the specific parameters of interactions, suggesting future work on updating models to adapt to dynamic workflows.
  • Leveraging Indexing: For interactive linked views, the authors suggest future work on leveraging indexing techniques to further reduce latency.
  • Extending to Other Languages: The techniques developed for Vega could potentially be generalized to other visualization languages that compile into dataflow graphs.

Summary updated

BibTeX
@inproceedings{yang2024optimizing,
  author = {Junran Yang and Hyekang Kevin Joo and Sai S. Yerramreddy and Dominik Moritz and Leilani Battle},
  title = {{Optimizing Dataflow Systems for Scalable Interactive Visualization}},
  booktitle = {Proc. ACM Manag. Data},
  year = {2024},
}
Figure