Overview
Slung is a high-performance stream processing platform designed for temporal data with full historical context. It enables you to write real-time functions that compute over data streams while maintaining access to complete historical data. Built with Zig for maximum performance, Slung processes millions of events per second with minimal memory overhead (8.7MB per 1M events) and sub-millisecond query latencies.Hardware Requirements: 1 GB RAM minimum, 1 CPU core, and storage for your data
Key Features
TSM Tree Storage
Efficient time-series storage using TSM tree with Gorilla encoding, achieving 9.12 bytes per data point with skip list cache and Bloom filters.
Real-time Ingestion
WebSocket-based streaming ingestion with non-blocking channels, processing over 1.2M writes per second.
Query DSL
Expressive query language with aggregations (AVG, SUM, MIN, MAX, COUNT), tag-based filtering with boolean logic (AND, OR, NOT), and flexible time ranges.
WASM Workflows
Execute custom workflows written in Rust and compiled to WebAssembly with live query subscriptions and HTTP/WebSocket writeback.
Full Historical Context
Query both real-time streams and historical data with unified query interface.
High Performance
Sub-millisecond query latencies (avg 49.99ms for 1M points), efficient compression, and minimal memory footprint.
Performance Benchmarks
Real-world performance on i5-10210U with SAMSUNG MZVLB256HAHQ-000H1 (ReleaseFast):Get Started
Begin your journey with Slung by following these guides:Quickstart
Get Slung running in minutes with a complete working example
Installation
Build Slung from source using Zig and Nix
Core Concepts
Learn about data model, TSM tree, and workflows
Architecture Highlights
TSM Tree Storage Engine
The TSM (Time-Structured Merge) tree provides efficient storage for time-series data:- Cache: Skip list for in-memory writes
- Disk entries: Gorilla/delta encoding for compression
- AMQ filters: Bloom filters for fast lookups
- Multi-level compaction: Planned for future releases
Stream Pipeline
Non-blocking WebSocket channels with stream rx/tx pool manager for high-throughput ingestion:- Multiple concurrent connections
- Binary protocol for minimal overhead
- Automatic connection lifecycle management
Query Engine
Parallel query execution with async iterators:- Real-time and historical queries
- Tag-based filtering with boolean operators
- Time range support with relative units
- Aggregation operations (AVG, SUM, MIN, MAX, COUNT)
WASM Runtime
Execute custom workflows with full access to Slung’s capabilities:- Host functions for querying data
- Life cycle manager
- HTTP and WebSocket writeback
Use Cases
- Real-time monitoring: Track metrics with live aggregations and alerts
- Anomaly detection: Analyze patterns across historical and real-time data
- IoT data processing: Ingest and process sensor data streams
- Time-series analytics: Complex queries over temporal data
- Custom workflows: React to events with WASM-based logic
Next Steps
Install Slung
Follow the installation guide to build Slung from source
Run the Quickstart
Complete the quickstart tutorial to send your first events
Explore Core Concepts
Learn about the data model and query syntax
Build Workflows
Create custom workflows with the Rust SDK