We know MQTT is based on TCP.
Why don't we directly using plain TCP connection for live data? Recently I'm using plain TCP for realtime / live connection for transfer sensor data to another device through plain TCP connection in internet.
Architecture that I make:
IoTBoard -> Server(VPS)-> ClientDevice(eg: smartphone)
This architecture looks similliar like MQTT:
Publisher -> Broker -> Subscriber
The format data I used looks like this in plain TCP in IoT board for one update data.
device_id(defined by programmer)|meta_data|sensorA_val|sensorB_val|etc
So basically it's just sending plain text to server
So I'm using pipeline separator for every topic. Then the server handle it like filtering pipeline before send to client.
Also I heard websocket is good for live data too, why it's not better than MQTT?
Do you think what am I doing is the best?