Skip to main content

Introduction to Eventflux

Eventflux is a high-performance Complex Event Processing (CEP) engine built from the ground up in Rust. It processes streaming data in real-time using familiar SQL syntax with powerful streaming extensions.

Why Eventflux?

Eventflux delivers over 1 million events per second with zero garbage collection pauses, making it ideal for latency-sensitive applications like financial trading, IoT analytics, and real-time fraud detection.

Key Features

Proven & Tested

Eventflux has 1,400+ passing tests covering all core functionality:

FeatureStatusTests
SQL ParserProduction ReadyNative streaming extensions
9 Window TypesProduction Ready200+ tests
Pattern MatchingProduction Ready370+ tests
JoinsProduction ReadyINNER, LEFT, RIGHT, FULL
AggregationsProduction ReadyCOUNT, SUM, AVG, MIN, MAX, STDDEV
State ManagementProduction ReadyCheckpointing, Recovery

SQL-First Design

Write queries in familiar SQL with streaming extensions:

DEFINE STREAM SensorReadings (
sensor_id STRING,
temperature DOUBLE,
timestamp LONG
);

SELECT sensor_id,
AVG(temperature) AS avg_temp,
MAX(temperature) AS max_temp
FROM SensorReadings
WINDOW TUMBLING(5 min)
GROUP BY sensor_id
HAVING MAX(temperature) > 100
INSERT INTO Alerts;

Comprehensive Window Support

Eventflux supports 9 window types for different streaming scenarios:

Window TypeDescriptionUse Case
TumblingFixed, non-overlappingPeriodic reports
SlidingOverlapping with slideMoving averages
LengthCount-basedLast N events
LengthBatchCount batchesBatch processing
TimeContinuous timeRolling windows
TimeBatchTime batchesPeriodic snapshots
SessionGap-basedUser sessions
ExternalTimeEvent timeOut-of-order events
DelayTime delayLate arrivals

Pattern Matching

Detect complex event sequences with temporal constraints:

-- Detect temperature spike pattern
FROM SensorReadings
MATCH (e1=TempReading -> e2=TempReading -> e3=TempReading)
WITHIN 5 min
FILTER e2.temperature > e1.temperature
AND e3.temperature > e2.temperature
SELECT e1.sensor_id, e1.temperature AS start_temp, e3.temperature AS end_temp
INSERT INTO TempSpikes;

Blazing Performance

  • Lock-free pipelines using crossbeam queues
  • Zero-allocation hot paths with object pooling
  • No garbage collection pauses
  • Rust's memory safety without runtime overhead

Quick Example

Here's a complete example that filters and aggregates sensor data:

use eventflux::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let manager = EventFluxManager::new();

let app = r#"
DEFINE STREAM Input (sensor_id STRING, value DOUBLE);

SELECT sensor_id, AVG(value) AS avg_value
FROM Input
WINDOW TUMBLING(1 min)
GROUP BY sensor_id
INSERT INTO Output;
"#;

let runtime = manager.create_runtime(app)?;
runtime.start();

// Send events
runtime.send("Input", event!["sensor-1", 25.5])?;
runtime.send("Input", event!["sensor-1", 26.0])?;
runtime.send("Input", event!["sensor-2", 18.3])?;

Ok(())
}

Next Steps

Ready to dive in?

Community

Work in Progress

Eventflux is under active development. APIs may change between releases. We recommend pinning to specific versions in production.