Architecture
LiteJoin packs an entire stream processing engine into a single Go binary. There are no external dependencies — no message broker, no database server, no coordinator. Everything runs in-process, backed by SQLite.Engine Overview
SQLite Storage
LiteJoin uses SQLite in WAL (Write-Ahead Logging) mode as its primary data store. Every topic maps to a SQLite table withkey, payload, and timestamp columns.
Sharding
Data is distributed across multiple SQLite databases using consistent hashing (FNV) on the message key:.db file:
Write Path
A single writer connection per shard ensures zero write contention. Messages are batched by the Writer component and flushed everyflush_interval (default: 10ms) or when batch_size (default: 1000) is reached.
Writes use SQLite’s INSERT OR REPLACE (upsert), meaning the latest value for a key always wins.
Read Path
A configurable pool of reader connections (default: 4 per shard) handles queries from the joiner, windower, and snapshot API. SQLite’s WAL mode provides snapshot isolation — readers see a consistent state even while writes are in progress.Retention
A background goroutine periodically deletes data older than the configured retention duration:Tiered Storage (Optional)
When enabled, LiteJoin compacts expired data into Parquet files before deleting from SQLite. These files are queryable via an embedded DuckDB instance and can optionally be uploaded to cloud object storage (S3, GCS, Azure Blob):| Tier | Storage | Latency | Retention |
|---|---|---|---|
| Hot | SQLite (sharded) | Sub-millisecond | Configured TTL (e.g., 1h–24h) |
| Warm | Local Parquet files | Milliseconds | Configurable (default: 7 days) |
| Cold | Cloud object storage | Seconds | Indefinite |
Replication (Optional)
LiteJoin integrates with Litestream for continuous backup of SQLite shards to cloud object storage. This enables:- Disaster recovery — restore shards from S3/GCS on startup
- Ephemeral deployments — containers can boot, restore state, and resume processing
- Point-in-time recovery — roll back to any point within the retention window
At-Least-Once Delivery
When enabled, failed sink deliveries are captured in a dead-letter queue (DLQ) backed by a dedicated SQLite database. A background retry worker redelivers messages with exponential backoff:LiteJoin Studio
LiteJoin Studio is a Wails desktop application (Go backend + React/Vite frontend) that embeds the LiteJoin engine directly. It provides:- Visual pipeline builder — add sources, configure joins and windows via UI
- Live SQL editor — write queries with autocomplete and see results stream in real-time
- One-click deploy — export a production-ready
litejoin.yamlconfiguration