shortysbest Posted August 2, 2011 Share Posted August 2, 2011 I'm building a social networking, quite similar to facebook at the moment, however what I am looking to do is have as much realtime data as possible, but the problem with that for me has been in order to do so I have had to have a number of periodic queries hitting the server, depending on what the purpose, different frequencies, some maybe 5 seconds, and some 60 seconds, however I would like to be able to have the data be as real time as possible but not have to give up the performance side of my website. I had a version of my website that had several to 10 periodic queries to the server quite frequently, the downside to that was my website would be very slow, and if you weren't using the website (which would clear some of the queries) the page may never load, or take a very long time. Well I ditched that version and created a entire new version. So my idea to "fix" this problem was to have a table in my database dedicated for updating the users information when new information was added. Basically what I would do is whenever a user writes a new post on somebodies profile it would also insert a row in the dedicated table which would have the users_id the post was for, along with the command number associated with that action. There would be a single periodic updater that would query this table every 5-10 seconds and would search for commands, once it found a command it would then fire the function that would carry out that action. So in this example, it would load the new post into the users feed. Does this sound like it would be an efficient way of faking Comet or some other data push system? Quote Link to comment https://forums.phpfreaks.com/topic/243538-would-this-method-work-for-a-kind-of-ajax-push-system/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.