Clickstream Analytics with Apache Kafka and Spark Structured Streaming versus Nightly Batch

Is a nightly batch job still good enough for e-commerce click analytics, or should the numbers be streamed? One generated business day of 3,000,000 click events - views, carts and purchases, some arriving minutes or hours late - goes through Apache Kafka 4.4.0 into two pipelines with the same KPI code: Apache Spark 4.3.0 batch jobs (nightly and hourly) and Spark Structured Streaming with four watermarks and four live runs. Because every event's delay is known, every missing event is counted exactly.

NOTE: Generated (seeded) e-commerce click events, no personal data; Apache Kafka, Apache Spark and the application ran on one machine on 127.0.0.1. Batch freshness = schedule + measured job time; streaming freshness = measured per event.

Category: Big Data

Big Data Project BD01 from ProTechSC Academy, with graphical abstract, video demonstration and project guidance.