This episode weaves all the skills into real use cases: monitoring and alerting dashboards, fraud detection, real-time recommendation, and IoT processing. You'll also design an end-to-end streaming pipeline with data enrichment, stream joins, and real-time aggregations.

Twenty episodes built skills one at a time. Episode 20 is the final exam: how it all comes together in real use cases. Good streaming isn't just running technology — it must produce decisions, alerts, and dashboards that people use every day.
We'll build a monitoring dashboard with alerting, implement fraud detection and real-time recommendation, process IoT data, then design an end-to-end pipeline with data enrichment, stream joins, and real-time aggregation. This is the map for translating Flink into business value.
A monitoring dashboard is built from metrics exported to Prometheus (episode 13). From there, Grafana displays trends and rule-based alerts:
groups:
- name: flink-alerts
rules:
- alert: JobRestarted
expr: flink_jobmanager_job_restarts > 0
for: 1mflink_jobmanager_job_restarts is the metric counting job restarts. This rule fires an alert when a restart happens — without alerts, a silently restarting job won't be noticed until the problem worsens.
Besides technical metrics, watch business metrics: transaction volume per minute, failed data ratio, and aggregation latency. Custom metrics built with counters and gauges (episode 13) become the foundation of dashboards that answer business questions, not just infrastructure questions.
Fraud detection combines aggregation and CEP: transactions crossing a threshold within a time window trigger an alert immediately:
SELECT user_id, COUNT(*) AS jumlah, SUM(amount) AS total
FROM transactions
GROUP BY user_id, TUMBLE(event_ts, INTERVAL '10' MINUTE)
HAVING COUNT(*) > 10 AND SUM(amount) > 10000000;HAVING filters suspicious transaction groups. For subtler sequential patterns — for example two large transactions within one minute — combine with the CEP from episode 10.
Detection results aren't the end — send them to the alerting and case management systems:
./bin/flink run -d target/fraud-job.jar./bin/flink run -d submits the job. In production, alerts are directed to a Kafka topic consumed by the fraud detection platform, or directly to a paging system for critical cases.
Real-time recommendation uses current events, not just batch history: enriching with user data, then stream joins to combine clicks and catalog:
SELECT c.user_id, p.product_name
FROM clicks c
JOIN products FOR SYSTEM_TIME AS OF c.event_ts AS p
ON c.product_id = p.id;FOR SYSTEM_TIME AS OF ensures the recommendation uses the correct product version at the moment of the click. The results are sinked to a recommendation engine that returns the top-N products for each user.
Combine click frequency per user (state), favorite categories, and real-time signals into a score. A good recommendation pipeline is always built from stateful aggregation — exactly the pattern you've mastered in episode 6.
IoT produces a continuous stream of sensor data: temperature, vibration, energy consumption. Per-minute aggregation per device becomes the basis of monitoring:
SELECT device_id,
AVG(temperature) AS rata_temperature,
MAX(temperature) AS maks
FROM sensor_readings
GROUP BY device_id, TUMBLE(event_ts, INTERVAL '1' MINUTE);AVG and MAX give a summary per device. Add automatic alerts when maks crosses a threshold — early detection before equipment breaks.
Assemble all the components into one pipeline:
Kafka → Flink (enrich + join + aggregate) → Kafka → ClickHouse → GrafanaKafka collects raw events, Flink enriches them with dimensions (temporal join), joins streams, and aggregates; the results go to Kafka to be stored in ClickHouse; Grafana displays the dashboards and fires alerts.
./bin/flink run -d target/analytics-job.jarThe ./bin/flink run -d command submits the pipeline. From here, the whole value chain — from raw events to business decisions — runs in seconds, not hours.
Episode 20 brought everything together: monitoring dashboards with alerting, fraud detection based on aggregation and CEP, real-time recommendation with enrichment and stream joins, per-sensor IoT processing, and designing an end-to-end pipeline from Kafka to dashboards.
The key takeaways:
In the next episode, episode 21, we'll discuss ecosystem & tooling — integration with Apache Beam, the Flink SQL Gateway, and the State Processor API, tooling like the Flink CLI, web UI, and IDE plugins, community resources and RFCs/FLIPs, and managed cloud offerings. You'll see Flink as part of a broader ecosystem.