Abstract
Afterburner is a high-performance analytical database implemented entirely in JavaScript that runs inside a web browser. By utilizing a "split-execution" strategy, it offloads interactive data exploration tasks from cloud backends to the client, achieving performance that rivals native, compiled databases while eliminating the latency of constant server round-trips.
Introduction: The "Dumb Terminal" Bottleneck
In modern data science workflows, the web browser is the primary interface (e.g., Jupyter Notebooks), yet it often functions as a "dumb terminal." Heavy lifting—query execution and data management—remains tethered to cloud backends. This architecture introduces two major bottlenecks for interactive analytics:
- Latency: Every parameter tweak (like adjusting a date range) requires a network round-trip and server-side execution.
- Server Load: Repeatedly hitting the backend for minor variations of the same query is inefficient and costly.
While JavaScript SQL engines exist, they typically lack the scalability for large-scale analytical workloads. Afterburner addresses these issues by transforming the browser into a first-class execution engine.
System Design and Methods
Afterburner’s performance stems from two technical pillars designed to bypass traditional JavaScript overhead:
- Columnar Storage with Typed Arrays: Instead of memory-heavy JavaScript objects, Afterburner uses Typed Arrays to implement a columnar memory layout. This allows for dense, contiguous data storage that is highly compatible with modern CPU caches.
- Query Compilation via
asm.js: Afterburner compiles SQL queries intoasm.js, a strictly-typed subset of JavaScript. This enables Ahead-of-Time (AOT) compilation, removing the overhead of runtime type checks and garbage collection.
The Split-Execution Workflow
The system introduces a FREE clause in its API. When a user identifies a column for interactive exploration (e.g., l_shipdate), the backend generates a local materialized view (MV). This pre-aggregated dataset is shipped to the browser once. Subsequent queries that only change predicates on the "free" column are executed entirely within the browser.
Performance Evaluation
The authors evaluated Afterburner using the TPC-H benchmark at Scale Factor 1 (1 GB) for in-browser performance and Scale Factor 100 (100 GB) for split-execution testing.
- Native-Level Performance: Afterburner was only ~1.3x slower than a single-threaded instance of MonetDB, a mature native columnar database.
- Interaction Speedups: For TPC-H Query 6, standard backend execution took ~4.4 seconds. Once the MV was in the browser, Afterburner executed the same query with different parameters in just ~10 milliseconds.
- Scalability: Unlike competing JS engines (Lovefield or Sql.js), Afterburner successfully handled datasets that typically cause browser crashes.
Key Insights and Discussion
- Busting the "JS is Slow" Myth: With
asm.jsand typed arrays, JavaScript performance can get within 4–5x of highly optimized C++ for numeric filters and is nearly identical for string operations. - The Breakeven Point: Shipping data to the client has an upfront network cost. However, for many TPC-H queries, the "breakeven" point is reached in just 2 to 3 queries, after which local execution is significantly faster than cloud round-trips.
- Operational Simplicity: Afterburner requires zero installation. It is "just a webpage," making it cross-platform and easier to manage than local native database deployments.
Limitations and Future Work
Despite its strengths, Afterburner faces challenges regarding browser memory limits; "freeing" too many columns can exceed available RAM. Future work aims to automate the inference of "free" columns based on user behavior and to implement a more sophisticated cost-based query optimizer. Additionally, the current prototype does not automatically synchronize local views with changing cloud data, which may limit its use in real-time monitoring scenarios.
Summary updated