Friday, July 9, 2010

"Stateful" Web Applications

There's a dumb title, "Stateful Web Applications". One attribute that I love about the web is that it is stateless, that means that you can actually use the web to write applications that could scale.
Programmers who really did not understand the web spent all of their time adding artificial "statefulness" in the form of "session stores".  Instead of using the power of the web we started creating "applications" that simply used http as a transport for our evil doing. Then came the RESTafarians who lead the charge trying to teach others of the virtues and power of the web.
Now I find myself in the trenches trying to lead others to the promise land! Then I run into little nuggets like the WebSockets API.
WebSocket object with an open connection must not be garbage collected if there are any event listeners registered for message events.
I can see the future! Millions developers out there chomping at the bit, waiting to write a bunch of crappy socket code in JavaScript that they could not write in C. Can you see it? The thousands of failed projects in our future that tried to use WebSocket connection pooling frameworks to help deal with the fact that when under heavy load the server had too many file descriptors open, which brought the application to its knees. I guess I better start learning more about this technology so that someone can pay me to re-write it using a stateless technology. Good thing we already have the web.

No comments: