Skip to main content

DazzleDuck SQL Servers

DazzleDuck can run as either an HTTP-based SQL service or a high-performance Arrow Flight SQL (gRPC) server. Both servers share the same execution core but expose different protocols and client experiences.

Use the tabs below to explore each server in detail.

DazzleDuck SQL HTTP Server

HTTP layer that exposes DuckDB as a remote, Arrow-native analytics service.


Overview

The DazzleDuck SQL HTTP Server provides a RESTful HTTP interface on top of the DazzleDuck SQL execution engine. It allows clients to execute analytical SQL queries, ingest Arrow data, and manage query lifecycles using simple HTTP requests, while internally delegating all execution to a single Arrow Flight SQL producer backed by DuckDB.

This module is intentionally designed as a thin HTTP façade — it does not re-implement query planning or execution logic. Instead, it focuses on:

  • HTTP request handling
  • Authentication and authorization
  • Streaming Arrow results over HTTP
  • Coordinating ingestion and query lifecycle APIs

What This Server Provides

API Reference (HTTP)

All API endpoints are prefixed with /v1.

MethodEndpointDescription
POST/v1/loginAuthenticate and retrieve a JWT token.
GET/POST/v1/queryExecute a SQL query. Params: q (query string).
POST/v1/planGenerate a query plan (splits) for distributed execution.
POST/v1/ingestUpload Arrow stream to a Parquet file. Query param: path.
POST/v1/cancelCancel a currently running query.
GET/v1/uiOpen the web dashboard.
GET/healthServer health check (Unversioned).

Key Design Principles

  • Arrow-first: All data transfer uses Apache Arrow formats
  • Single execution core: One DuckDB + Flight SQL producer handles all work
  • Streaming by default: Large results are streamed with backpressure awareness
  • Minimal abstraction: HTTP layer stays thin and predictable

When to Use the HTTP Server

This module is ideal when you need:

  • SQL-over-HTTP access to DuckDB
  • A backend for web-based analytics
  • Lightweight data APIs returning Arrow data
  • A bridge between Arrow pipelines and SQL analytics

Relationship to Other Modules

  • Execution: Delegates to dazzleduck-sql-flight
  • Security: Integrates with dazzleduck-sql-login
  • Metrics: Exposes telemetry via dazzleduck-sql-micrometer
  • UI: Serves the Arrow JS frontend

Architecture

Internal design of the DazzleDuck SQL HTTP Server.

High-Level Design

Client

HTTP / HTTPS

Helidon WebServer

QueryService → FlightProducer.getStream()
PlanningService → FlightProducer.getFlightInfo()
IngestionService → Bulk Arrow ingestion
CancelService → Query interruption
LoginService → JWT issuance

DuckDB execution engine
(exposed via Arrow Flight SQL)

Delegation Model

The HTTP layer:

  • Does not execute SQL itself
  • Does not manage DuckDB state
  • Acts as a protocol bridge

All query execution, planning, ingestion, and cancellation are delegated to a single Flight SQL producer.


Streaming Model

  • Results are streamed as Arrow IPC batches
  • Backpressure is honored end-to-end
  • Large results do not accumulate in memory

Error Handling

Custom exception hierarchy maps failures to HTTP responses:

ExceptionHTTP Status
BadRequestException400
UnauthorizedException401
InternalErrorException500

Summary

The HTTP server provides a clean separation:

  • Thin HTTP façade
  • Unified execution engine
  • Predictable data flow