All Research Tracks
R19 Β· Systems Research

WebAssembly-Native Query Operators

SkeinDB proposes WebAssembly for extensions, but what about core query operators? Compiling query plans to WebAssembly enables execution on edge nodes, in browsers, or on constrained devices while maintaining sandboxing guarantees. This extends SkeinDB's single-binary philosophy to making the query plan itself a portable artifact.

Research Proposal β€” Mapped to backlog in docs/RESEARCH_BACKLOG.md

πŸ”¬ What's Novel

πŸ”§ Technical Approach

Phase 1 β€” Operator Library

Core operators (scan, filter, project, join, aggregate) implemented in Rust and compiled to WebAssembly modules. A stable ABI for data exchange between operators and the runtime.

Phase 2 β€” Query Compilation

Plan-to-Wasm compilation: operator selection from the library, operator fusion for pipeline efficiency, and serialization of compiled plans for network transmission.

Phase 3 β€” Runtime Environments

Three deployment targets: server-side execution via Wasmtime, browser-based execution via native Wasm support, and edge node execution on CDN worker runtimes.

Phase 4 β€” Optimization

SIMD utilization within Wasm, memory layout optimized for cache efficiency, and streaming evaluation patterns to handle result sets larger than available memory.

πŸ§ͺ Hypotheses

H1

Wasm query operators achieve performance within 2x of native execution while providing safety guarantees and portability.

H2

Wasm operators can execute in browsers, enabling client-side query evaluation over locally cached data.

H3

Wasm compilation enables query shipping to edge nodes, reducing data transfer compared to result shipping.

πŸ”— SkeinDB Integration

Wasm Runtime
SkeinQL RPC
Query Planner
Edge / CDN Layer
ValueID Store

πŸ“š Key References