Home » Php » Txt file or database for real time?? (php)

Txt file or database for real time?? (php)

Posted by: admin February 25, 2020 Leave a comment

Questions:

Ok, I have a table in PostgreSQL. Then I have many users watching that list which is refreshing every 3 seconds (real time).

So what is the best option to see updated data in real time:

1) Run a query every 3 seconds in database.
2) Loading txt file (with JSON) generated each time the table receives a change.

Note: In both cases Im using ajax to refresh content.

Thanks…

How to&Answers: