
10/27/2022 · Wei Rui
What this post added
This post details the construction of a real-time IoT motion detection and alerting system using Confluent Cloud and ksqlDB. It outlines the hardware (Raspberry Pi Zero W) and software stack, including the use of the Motion software for detection, cURL for AWS S3 uploads, librdkafka for publishing events to Confluent Cloud, and Docker for containerization. The architecture involves IoT devices emitting motion events to Kafka, which are then processed by ksqlDB. The post demonstrates ksqlDB stream creation and querying for both real-time monitoring (using push queries with EMIT CHANGES) and past event search (using pull queries). It also includes code snippets for the ksqlDB push query web worker and a sample SQL pull query.