I am currently working on a personal project where I have several iot devices (can reach thousands) which have several sensors attached. However, I am not quite sure about the best way to design the communication flow. Specifically, I need both real-time data for monitoring and historical data and real-time control.
Initially, I thought about having an MQTT broker for communication between my iot devices and backend (django) and then through my backend I can use websockets (using redis) to forward real-time updates to my mobile app and http for historical data. As for the control, I will push control messages to the backend using ws and then the backend forwards it to the specified device topic. Furthermore, I will have notifications services and other databases on Django. However, I’m unsure if this is the most efficient approach.