OK, so the relay board is a local mcu with a relay switch that is controlled directly from a cloud server (AWS based). That is now clearer.
Yes, you can install Node-RED on the cloud server of course.
MQTT is likely to be more stable than a direct TCP connection since it supports reconnections and (somewhat) guaranteed delivery of messages. Of course, that is at the expense of a more complex cloud server configuration since you now need to install, configure and maintain an MQTT broker in addition to Node-RED.
You will also need to pay very careful consideration to the security of both your relays and the cloud server. Make sure that all traffic, including initial connections/handshakes are over strongly encrypted links (TLS), move well-known TCP/IP ports to alternatives to reduce attacks, install and configure an OS-level firewall on the cloud server and also install and configure fail2ban to help prevent brute-force attacks. For TLS use, you will also want to install and configure
acme.sh and set up Let's Encrypt.
Poorly secured cloud servers and Internet connected IoT devices are the bane of the internet, please don't add to the problem even if you don't care about your own security.