I have a device network where each device has different sensors (temperature, humidity, etc..). Each device uploads raw measured weather data every 10 seconds to a apache/php/mysql REST API. There are a few 100 devices sending data and this will become more over time. Currently the data is added to a mysql table without any processing.
The string format of the device message is something like:
Which means that sensor
AA and sensor
I want to put the decimal converted hex values in a table so they can be processed further. What I do now is run a script every minute to see what new strings were added to the database. I will then convert these strings to decimal values and put them in a table.
Performance wise I have the feeling that polling new data every minute is pretty silly.
What would be the best way to do this?
have the rest api split the string and convert the hex values to decimal values and insert this immediately into the database
poll the database for new inserted strings and convert the hex values
use a mysql insert trigger to process the string by the database
any other ideas.