I am implementing long polling using mysql for a near realtime data update for clients.
Currently, this is what I have (and it works): A messages table, that holds messages between users,there is a clustering index using timestamps. Client starts an ajax request to poll. The server then, runs a db query to check for messages that are greater than a certain timestamp value continuously(sleeps for one second,then continues). Since the timestamp is indexed, the search times are very fast.
Aside of this, I now want to implement a todo list. (unlike messages, todolists, can be deleted/edited ).
To store todo lists, I wanted a separate table, with whatever logic. Assuming the read times are fast, is it good practice to poll for new data from multiple tables?
Aside of that , I would like to know if there is any difference between running two sql queries separately vs them being a single string, separated by a ';'
I want to ask that because I am using laravel, and I see no way to run multiple queries separated by ';'.