Q:

Realtime Search with AJAX?

What is the best way to push data to a client in real time? I am working on a test website with the new html5 history API when I ran into this conundrum. 
I am using the twitter API to make real time search for learning purposes, but 
So I understand that you could essentially submit a form over and over again, spamming PHP endlessly, but that doesn't seem like a good solution.
What is the best way to get data as data is created? (with jQuery, preferably) 
Thanks, David
Edit: I've looked into push engines, but there's got to be a way to do it without buying a service, right?

A:

There are two (actually more than that if you include browser plugins like flash) possible solutions I see: websockets and polling.  You don't like the idea of polling, and I would agree, depending on the scenario.  Polling has the drawback of keeping a user's session alive - i.e. they'll never get logged out - if it's polling the same domain.  However if you set it to poll every 5 seconds, the load is very minimal assuming you set it up to check for new data.  With jQuery you could implement a setInterval to poll (as I'm sure you've already investigated).  On another note... WCF introduces an HTTP-based TCP-socket-like connection called polling duplex that allows both client and server to communicate as if they were connected via TCP.  You can look up the performance on these - it's not that bad if you wanted to implement that somehow. I used Silverlight to implement this. Websockets are a relatively new technology that gives you two-way communication, but you're limiting your clients to those that use browsers that support these.  You also have to deal with browser-specifics.

