Real-World Event Processing
See how EventFlux handles complex streaming scenarios with elegant SQL queries
High-Frequency Trading
Detect arbitrage opportunities by correlating price feeds from multiple exchanges in real-time. Trigger alerts when price spreads exceed thresholds within time windows.
-- Detect arbitrage opportunities across exchanges
SELECT a.symbol, a.price AS price_a, b.price AS price_b,
ABS(a.price - b.price) AS spread
FROM ExchangeA AS a
WINDOW TUMBLING(1 sec)
JOIN ExchangeB AS b
ON a.symbol = b.symbol
WHERE ABS(a.price - b.price) / a.price > 0.001
INSERT INTO ArbitrageAlerts;
IoT Anomaly Detection
Monitor thousands of IoT sensors simultaneously. Detect anomalies when temperature readings exceed thresholds, triggering maintenance alerts before equipment fails.
-- Detect temperature anomalies in IoT sensors
SELECT sensor_id,
AVG(temperature) AS avg_temp,
MAX(temperature) AS max_temp,
MIN(temperature) AS min_temp,
COUNT(*) AS reading_count
FROM SensorReadings
WINDOW TUMBLING(5 min)
GROUP BY sensor_id
HAVING MAX(temperature) > 100
OR MIN(temperature) < 0
INSERT INTO AnomalyAlerts;
Fraud Detection Patterns
Identify fraudulent transaction patterns by detecting sequences of events that match known fraud signatures. Flag accounts with suspicious rapid transaction bursts.
-- Detect suspicious transaction patterns
SELECT account_id,
COUNT(*) AS tx_count,
SUM(amount) AS total_amount,
AVG(amount) AS avg_amount
FROM Transactions
WINDOW SESSION(10 min, account_id)
GROUP BY account_id
HAVING COUNT(*) > 5
AND SUM(amount) > 10000
INSERT INTO FraudAlerts;
Dynamic Risk Classification
Classify incoming events dynamically using SQL CASE expressions. Categorize transactions by risk level based on multiple conditions and route them to appropriate handlers.
-- Classify transactions by risk level
SELECT tx_id, amount, country,
CASE
WHEN amount > 10000 AND country NOT IN ('US', 'UK')
THEN 'HIGH_RISK'
WHEN amount > 5000 THEN 'MEDIUM_RISK'
WHEN amount > 1000 THEN 'LOW_RISK'
ELSE 'MINIMAL_RISK'
END AS risk_level,
CASE type
WHEN 'WIRE' THEN 'Requires Review'
WHEN 'ACH' THEN 'Auto-process'
ELSE 'Manual Check'
END AS action
FROM Transactions
INSERT INTO RiskClassified;
RabbitMQ Event Pipeline
Build end-to-end streaming pipelines with RabbitMQ. Consume JSON events from queues, process with SQL queries, and publish results to exchanges. Perfect for microservices architectures.
-- RabbitMQ Source: Consume from queue
CREATE STREAM TradeInput (
symbol STRING, price DOUBLE, volume INT
) WITH (
type = 'source', extension = 'rabbitmq',
format = 'json',
"rabbitmq.host" = 'localhost',
"rabbitmq.queue" = 'trades'
);
-- RabbitMQ Sink: Publish to exchange
CREATE STREAM TradeOutput (
symbol STRING, price DOUBLE, category STRING
) WITH (
type = 'sink', extension = 'rabbitmq',
format = 'json',
"rabbitmq.host" = 'localhost',
"rabbitmq.exchange" = 'processed-trades'
);
-- Process: Filter and classify
INSERT INTO TradeOutput
SELECT symbol, price,
CASE WHEN price > 100 THEN 'high' ELSE 'low' END
FROM TradeInput WHERE volume > 1000;
Real-Time State Management
Maintain synchronized state tables from streaming data. Use UPSERT to insert new records or update existing ones, UPDATE to modify specific fields, and DELETE to remove stale entriesβall triggered by stream events.
-- Product catalog table
CREATE TABLE ProductCatalog (
sku STRING, name STRING, price DOUBLE, stock INT
) WITH (extension = 'inMemory');
-- Incoming inventory updates
CREATE STREAM InventoryStream (
sku STRING, name STRING, price DOUBLE, stock INT
);
-- UPSERT: Insert new products or update existing
UPSERT INTO ProductCatalog
SELECT sku, name, price, stock
FROM InventoryStream
ON ProductCatalog.sku = InventoryStream.sku;
-- UPDATE: Adjust prices from a separate stream
CREATE STREAM PriceUpdateStream (sku STRING, newPrice DOUBLE);
UPDATE ProductCatalog SET price = PriceUpdateStream.newPrice
FROM PriceUpdateStream
WHERE ProductCatalog.sku = PriceUpdateStream.sku;
-- DELETE: Remove discontinued products
CREATE STREAM DiscontinuedStream (sku STRING);
DELETE FROM ProductCatalog
USING DiscontinuedStream
WHERE ProductCatalog.sku = DiscontinuedStream.sku;
Why EventFlux?
Built for the demands of modern real-time data processing
Blazing Fast
Lock-free data structures and zero-allocation hot paths deliver over 1 million events per second.
SQL-First
Write queries in familiar SQL with streaming extensions. No new language to learn.
Memory Safe
Built in Rust with zero unsafe code in the hot path. No garbage collection pauses.
Pattern Matching
Detect complex event patterns with temporal constraints and correlation rules.
Stateful Processing
Enterprise-grade state management with incremental checkpointing and recovery.
Distributed Ready
Scale horizontally with built-in support for clustering and partition-aware processing.
Ready to Process Events at Scale?
Join the community building the next generation of stream processing.