Jump to content

Archived

This topic is now archived and is closed to further replies.

shortysbest

Would this method work for a kind of Ajax "Push" system?

Recommended Posts

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?

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.