This really is higher productivity appealing and "for future reference" than anything, but exactly how is Comet implemented around the database-side? I understand most implementations use lengthy-resided HTTP demands to "wait" until information is available, but exactly how is done around the server-side? So how exactly does the net server know when new information is available? Will it constantly poll the database?

this really is greatly application dependent. Probably the most likely implementation is a few kind of texting system.

Probably, your server side code will contain a number of parts:

  • a couple of application servers that hansle incoming demands,
  • a (separate) comet server that are responsible for all of the open connections to clients,
  • the database, and
  • some kind of texting infrastructure

the final one, the texting infrastructure is usually the key. This gives a means for that application servers to speak to the comet server. Then when a request is available in the application server will put a note in to the message queue telling the comet server to inform the right client(s)

How texting is implemented is, again, greatly application dependent. A simple implementation would certainly make use of a database table known as messages and poll that.

But with respect to the stack you intend on using there must be more sphisticated tools available.

In Rails I am using Juggernaut which simply listens on some network port. Whenever there's data to transmit the Rails Application server opens an association for this juggernaut push server and informs it things to send towards the clients.

What DB are you currently using? Whether it supports triggers, which many RDBMSs do in certain shape or form, then you may possess the trigger fire a celebration that really informs the HTTP request to transmit the appropriate response.

Triggers remove the necessity to poll... polling is usually not the very best idea.

PostgreSQL appears to possess very good support (even PL/Python).