What are some of the software technologies behind "real-time" web apps, like Twitter, Trello, or even Gmail? I know there's a webserver and probably a database on the backend, but what are the software pieces that make for that rich web interaction that I'm seeing more of today?
2 Answers
Comet plays an important role in these applications.
Comet is a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it.
http://en.wikipedia.org/wiki/Comet_%28programming%29
JavaScript is the glue between the comet servers and the browsers. Server software like Node.js are used to implement these comet servers that will have to handle many long-held connections.
Besides comet, these applications also need a good backend. The solutions may be very specific to the problem.
Twitter, for example, has to stream tweets to all your followers for each of your tweets. Facebook has to run machine learning algorithms to select which stories to stream on your News Feed.
Although different, these applications have many things in common: heavy use of cache, data denormalization, asynchronous jobs, are highly distributed.
Client-side, Javascript and Ajax.
Server-side, a plethora of different technology stacks.. As Raynos eluded to in his comment, virtually anything can be used to build a real time web application...
You could use a web server (such as Apache) to mediate communication between your clients and data, but you don't necessarily need to. You could also write your own HTTP handling on a server rather than deal with the overhead of using a third party web server yourself. A few examples might be (assume Javascript/AJAX client-side for each):
Language / Interface / Server
-------------------------------
Python / WSGI / nginx
Javascript / - / node.js
C++ / FastCGI / Apache
Erlang / - / Yaws (embedded)
PHP / mod_php / Apache
Again, those are just a few examples of possibilities. The possible permutations of tech stacks for implementing server-side solutions is virtually endless.
Edit:
Silly me. HTML5 is probably the biggest addition to the client-side tech stack that allows for rich web applications these days. The addition of features such as audio (Firefox has even exposed audio data to allow visualization of an audio spectrum through Javascript), video, database (WebSQL, IndexedDB), filesystem (sandboxed on most browsers, full system access available in Firefox through XPCOM components), WebGL and WebSockets are just a few of the big additions that HTML5 has brought along.

- 17,585
-
1WebSQL is deprecated, databases is just IndexedDB. XPCOM is being superceeded by OS.File. Also note that websockets is really important – Raynos Dec 07 '11 at 04:52
-
Should have mentioned that WebSQL was deprecated (thanks for pointing that out). Thanks for the heads up on OS.File, was unaware of that. And yes, websockets are definitely really important. – Demian Brecht Dec 07 '11 at 18:39