Jump to content

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


shortysbest

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.