ok, so then when the serial data arrives, you can simply test the value then trigger a database write if the value is seen - unless - you have to send a serial message to request the value?
Questions:
Do you have the src code for the aurduino?
Does your aurduino have WiFi (and would you switch to WiFi or wired Ethernet?
Then you can simply write to the serial port when an input change is detected in your Arduino source code. Then it will be 100% event driven (send the change of value when your Arduino detects a change) - no need to poll
In which case - could you not use MQTT instead of serial? Then it will be 100% event driven (publish the change of value when your Arduino detects a change) - no need to poll