0

I am writing a Flutter app that uses a NodeJS REST API server as it's backend. The NodeJS application also uses MySQL database to store data.

The data inside the MySQL gets updated by another application. What I want to do is to read some specific tables of the MySQL database every 1-10 seconds.

I also have a router point within the NodeJS app that I can send http.get() requests from my flutter app to read data from MySQL. But I don't know what is the best way of sending these kind of requests frequently?

I am also interested to know if there is a better way of doing that like using socket.io? Or maybe accessing the MySQL directly without using the NodeJS app?

best_of_man
  • 643
  • 2
  • 15
  • Create a background task that fires read() after every specific interval of time. Try working with workmanager & isolates – Prashant Apr 16 '23 at 18:01
  • where is mysql table? on server or on device? – Rahul Apr 16 '23 at 18:24
  • @Prashant: I don't know about that. Could you give me a code snippet or a link to see how does it work? – best_of_man Apr 16 '23 at 21:59
  • @Rahul: I edited my question and tried to add more information. The MySQL is on the remote server and I have access to that by sending `http.get()` requests through the NodeJS backend app. – best_of_man Apr 16 '23 at 22:01

0 Answers0