Flink ist die fortschrittlichste Engine für Stream Processing. Exactly-once-Semantik, Event Time Processing und State Management.
Warum Flink¶
Stream-first-Ansatz — Batch ist ein Spezialfall von Streaming.
Flink SQL¶
CREATE TABLE orders (
order_id STRING,
amount DECIMAL(10,2),
order_time TIMESTAMP(3),
WATERMARK FOR order_time AS order_time - INTERVAL '5' SECOND
) WITH ('connector' = 'kafka', 'topic' = 'orders', 'format' = 'json');
SELECT
TUMBLE_START(order_time, INTERVAL '5' MINUTE) AS window_start,
COUNT(*) AS order_count,
SUM(amount) AS revenue
FROM orders
GROUP BY TUMBLE(order_time, INTERVAL '5' MINUTE);
Vergleich¶
- Flink — True Streaming, niedrigste Latenz
- Spark Streaming — Micro-Batch, Batch+Stream-Hybrid
- Kafka Streams — Library, einfache Transformationen
Zusammenfassung¶
Flink ist die beste Wahl für niedrige Latenz und Exactly-once Processing. Flink SQL macht Streaming für Analysten zugänglich.
apache flinkstream processingreal-timestateful