Let’s consider I have a fleet of 1000 cars. The cars have a device on board that sends data (speed, location, amount of fuel, etc.) to our HiveMQ Broker. The data is sent event-driven.
Each car owner has access to a web page where they can see their car’s information live. So if Tom accesses the website he will see his BMW’s information, if Jeff accesses the website he will see his Bentley’s information, etc.
To connect the website with the MQTT broker (it allows only connections on 8883 with valid certificates), I have thought the following:
- To have a MQTT client on the webserver and to subscribe this to all the topics - although I think this would generate a bottleneck.
- Using the socket.io library (NodeJs) send the data to the corresponding people.
Is this state of the art?
How to avoid the bottleneck in the client who subscribes to all the topics?
Any suggestions or ideas on how to make this better and more scalable, for example if in the future there are 100,000 cars?