ETL Studio
← Back to ETL Studio

ETL Studio — Technical Documentation

Architecture Overview

ETL Studio is a zero-backend, browser-based ETL designer powered by DuckDB-WASM. Everything runs in the browser — data is processed locally using DuckDB's WebAssembly build, and no data ever leaves your device. The application follows a pipeline architecture where each step transforms data and passes it to the next step.

Key Design Decisions

DecisionRationale
DuckDB-WASM as engineFull SQL OLAP capabilities in-browser with near-native performance via WASM SIMD. No server needed.
CTE-based pipelineEach step compiles to a Common Table Expression. The entire pipeline is a single SQL query — efficient and debuggable.
Zustand for stateLightweight, TypeScript-friendly state management with minimal boilerplate and built-in persistence support.
File System Access APIRead and write project files directly to the user's local file system. No uploads, no server round-trips.
Vite + React + TypeScriptFast development experience with HMR, type safety, and a mature ecosystem.
PWA with WorkboxApp shell precached for offline use. WASM binaries cached with expiration for performance.

Pipeline Engine

Steps are compiled into a DuckDB SQL query using Common Table Expressions (CTEs):

WITH
  step_01 AS (SELECT * FROM source),
  step_02 AS (SELECT * FROM step_01 WHERE condition),
  step_03 AS (SELECT col, COUNT(*) FROM step_02 GROUP BY col)
SELECT * FROM step_03

Key Components

ComponentDescription
Step DefinitionsPure functions that convert a step's config into DuckDB SQL
CTE BuilderChains enabled steps into a single CTE-based SQL query
SQL ExecutorRuns queries against DuckDB-WASM and returns results
Preview SystemAuto-executes the pipeline on changes with debounced updates
State ManagementZustand stores for queries, steps, connections, UI state
File PersistenceFile System Access API + IndexedDB for project files

Step Categories

CategoryStepsDescription
Get Data Source File, Source Table Load data from files or database tables
Columns Set Names, Pick Columns, Change Type, Duplicate Manipulate column structure and types
Rows Filter, Sort, Remove Duplicates, Fill Null Filter and organize rows
Values Replace Values, Remove Errors, Fix Errors Clean and transform cell values
Transform Add Index, Formula, Pivot, Unpivot, Clean Text Advanced data transformations
Combine Append Tables, Join Tables Merge data from multiple sources
Aggregate Group & Aggregate Summarize and group data
Advanced Custom SQL Write hand-crafted SQL with AI assistance
Output Export to File Export results to CSV, Parquet, Excel, JSON, JSONL

AI Integration

ETL Studio supports multiple AI providers for natural language to SQL generation:

AI settings are configured in the AI panel (click the "AI" button in the header). The AI Setup modal offers the remote providers above plus a "Local (browser)" card for in-browser models. API keys are stored in your browser's localStorage and never sent to any server except the API endpoint you choose; local models need no key and never leave your device.


Data Flow

  1. Create a query — Click "+" in the left panel
  2. Add data source — Use "Get Data" step to load a file or table
  3. Add transform steps — Filter, clean, aggregate, pivot, etc.
  4. Preview results — Each step shows its output in the center panel
  5. Export — Add an "Export to File" step or use the Run All button

Export Formats

FormatExtensionUse Case
CSV.csvUniversal spreadsheet format
Parquet.parquetColumnar storage, efficient for large data
Excel.xlsxMicrosoft Excel workbooks
JSON.jsonFull result as a JSON array
JSONL.jsonlOne JSON object per line, streaming-friendly

Technical Details

DuckDB-WASM

The app uses DuckDB's WebAssembly build to run SQL queries entirely in the browser. DuckDB is an in-process SQL OLAP database that excels at analytical queries on large datasets. The WASM build runs at near-native speed using WebAssembly SIMD instructions.

CTE Pipeline

Each enabled step becomes a CTE (Common Table Expression) in a single SQL query. The CTE builder chains them together, resolving prev references to the prior step's CTE name. Cross-query references (e.g., FROM other_query) are resolved by inlining the referenced query's compiled SQL as a subquery.

State Management

Zustand stores manage all application state. The project file (etlstudio.json) is serialized/deserialized via the File System Access API and persisted to the user's local file system. Auto-save triggers 800ms after the last change.

File System Access API

The app uses the File System Access API (Chromium browsers) to read and write project files directly to the user's file system. Folder connections use the same API to register directory handles, enabling DuckDB to query files in linked folders.

PWA & Caching

The app uses vite-plugin-pwa with Workbox for service worker management:


Build & Deploy

Development

npm install
npm run dev

Runs at http://localhost:5173 with HMR.

Production Build

npm run build

Output goes to dist/. Serve with any static file server.

Deployment

Push to any static host (GitHub Pages, Netlify, Vercel, Cloudflare Pages, S3). The included GitHub Actions workflow handles GitHub Pages deployment automatically.


← Back to ETL Studio · README