There isn't enough information here to answer. Both of them can easily download data every 3 seconds. Which one is "better" depends on many other factors.
There isn't enough information here to answer. Both of them can easily download data every 3 seconds. Which one is "better" depends on many other factors.
If you create both ends of the communication (I mean both the API and the client), and If I were you, I would prefer MQTT which is more light-weighted. If you don't, and you just consume the API, then as it is already said in this thread it depends on the API plus the latency of the server. And you might also consider some policies by several ISPs / Cloud providers that tend to ban IPs with lots of HTTP requests.
"On my server, I use Node.js with MQTT to fetch data from an external site every 5 seconds. The Node.js process is running under PM2. My publisher app connects to the MQTT broker. When many users connect to the publisher app, is it possible for the server to encounter errors?"