#sql #data-fusion #sql-parser #streaming-parser #extension #emit #streaming-interface #watermarks #query-planning

laminar-sql

SQL layer for LaminarDB with streaming extensions

2 unstable releases

new 0.10.1 Feb 7, 2026
0.1.1 Feb 6, 2026

#2525 in Database interfaces

Apache-2.0

3MB
66K SLoC

LaminarDB

A high-performance embedded streaming database in Rust. Think "SQLite for stream processing" with sub-microsecond latency.

Features

  • Embedded-first: Single binary deployment, no cluster required
  • Sub-microsecond latency: < 1μs event processing on the hot path
  • SQL-native: Full SQL support with streaming extensions
  • Thread-per-core: Linear scaling with CPU cores
  • Exactly-once semantics: End-to-end delivery guarantees

Quick Start

# Build all crates
cargo build --release

# Run tests
cargo test

# Run benchmarks
cargo bench

# Start the server
cargo run --bin laminardb

Architecture

LaminarDB uses a ring architecture to separate concerns:

  • Ring 0 (Hot Path): Event processing with zero allocations
  • Ring 1 (Background): Checkpointing, WAL, compaction
  • Ring 2 (Control Plane): Admin API, metrics, configuration

See docs/ARCHITECTURE.md for details.

Documentation

Performance

Metric Target Status
Throughput 500K events/sec/core 🚧 In Progress
State Lookup < 500ns p99 🚧 In Progress
Event Processing < 1μs 🚧 In Progress
Recovery Time < 10s 🚧 In Progress

License

Apache License 2.0 - see LICENSE for details.


lib.rs:

LaminarDB SQL

SQL interface for LaminarDB with streaming extensions.

This crate provides:

  • SQL parsing with streaming extensions (windows, watermarks, EMIT)
  • Query planning and optimization via DataFusion
  • Streaming-aware physical operators
  • SQL-to-operator translation

Streaming SQL Extensions

-- Tumbling window with EMIT
SELECT
  window_start,
  COUNT(*) as event_count
FROM events
GROUP BY TUMBLE(event_time, INTERVAL '5' MINUTE)
EMIT AFTER WATERMARK;

-- Stream-to-stream join
SELECT *
FROM orders o
JOIN order_items i
  ON o.order_id = i.order_id
  AND i.event_time BETWEEN o.event_time AND o.event_time + INTERVAL '1' HOUR;

Dependencies

~88MB
~1.5M SLoC