Skip to main content

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
This project is currently in active development (WIP) and is not ready for production use.

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):
Ingestion:
- 1 billion events in 772.57s
- Write latency: 772ns per event
- Throughput: 1,295,336 events/sec
- Peak memory: 575 MiB
- Storage: 9.12 bytes per point

Querying:
- Range query (1M points): avg 159.87ms
- Query latency: avg 49.99μs per point

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

1

Install Slung

Follow the installation guide to build Slung from source
2

Run the Quickstart

Complete the quickstart tutorial to send your first events
3

Explore Core Concepts

Learn about the data model and query syntax
4

Build Workflows

Create custom workflows with the Rust SDK

Build docs developers (and LLMs) love