I would like to allow a user via browser to receive updates if a database record has been changed in (near) real time without reloading the web page.
The idea is:
User opens url /dbrecord.php?id=12345
Registers for SSE (or something else) to receive updates to the record
Received on screen notification of what has been changed in the record without reloading the page
However this needs to be performant as there are a lot of DB Change events and a lot of potential users. Can you please let me know if the approach is good or are there better technologies / approaches to build something like this?
UPDATE: Found this - Server Side Events with PHP & MySQL But it requires a while(true) loop in the PHP script and this cannot be good to have the SQL Query in there?! Any feedback?
Thanks, fj