Interactive Single Page Application

I'm planning on developing my first SPA as an experiment. I have an idea of an interactive forum platform that can work in a single page. Notifications and all these fancy features included.

For many years, I've developed many web applications using PHP on the server side and AJAX. Question is, how can this be applied to my situation (or a similar one)? The user has to be logged in and he should be receiving updates considering the content (new replies, new topics and the list goes by). I consider the standard, which is request-response and as I see it, it's not the case here.

Connection between user and server has to be persistent. If I'm going to make a long-polling ajax application then why should I consider single page apps? It's necessary that the server keeps a list of connected users and push updates to them (like node.js, socket.io etc). These technologies seems to be new in the field of web development.

My question is what's the standard? How Twitter does it, how Facebook does it, how Gmail does it and stuff... I consider technologies like Knockout.js, Sammy.js, Backbone, Underscore and stuff. These are great and I can handle 'em. What about the server? What about the famous "real-time" web?

Any advice of strategy for the above example is useful and accepted.

Thanks in advance for even bothering to read this.

If you are asking what the standard for a realtime application which also stores state, then there isn't one. There are numerous ways to "skin a cat."

Socket.io, at the barebones end, will abstract away whether you use AJAX long-polling or websockets. (A browser that doesn't support websockets will automatically switch to AJAX long-polling)

The "request/response" model isn't over http, it's over websockets using a pub/sub model of events and listeners. A listener on the server side, for instance, would detect a new tweet in its twitter api connection, and broadcast an event over websockets for a client side socket listener, which would then update the DOM in real time with the new information being received over websockets....... this socket communication with events and listeners goes both ways. I would paste in some code, but I'm not on my machine which has my socket code on it, and simply googling for ANY use of socket.io with express will show you the ropes.

Edit: The "standard way" is Socket.io/Express on server-side, with Backbone/Socket.io on the client side.

An excellent architectural description of real-time stack for Trello by Fog Creek: http://blog.fogcreek.com/the-trello-tech-stack/