I was sick yesterday for the first time in about 2.5 years. Something dodgy I ate because I was up all night doing what you do when you are violently ill, but was pretty good by the next morning. Anyway without grossing you out too much there is always a good side to things. In the case of being sick: it is hard to read, write, work on your PC etc so all you can do is think (and play a little Xbox…)
In my case I was thinking about a number of things, but it kept coming back to stateful web sites. This was prompted in part by a client request last week. They wanted a prompt to save when leaving a record on a maintenance web page. Simple request. Hard to do. OK, so you can do it in a round about way. But the reason these and a bunch of other things are hard is due to the statelessness of web development. By definition web development is stateless.
Ask most database web developers what their main issue with web development is and it’ll be managing state.
Now this really bugs me. Why, when on the desktop we can have massive complexity in our database apps, can’t we transfer this same functionality to the web.
And when you boil it down, the main reason will be resources. ie the logic will be this:
consider that you have a site with thousands or hundreds of thousands of users daily, the amount of server resources to handle state (including dropped connections etc) would be massive.
Any my response is: so what? build smarter servers
If google can master distributed server technology based on a customised linux kernal, why don’t they consider offering a new hosting platform that offers statefull web sites.
They could publish their own version of PHP or something similar that incorporated a stateful model. Make the model simple (eg avoid the .Net path of overwhelming complexity) and hosting simple and I think people would flock to it.
As we all know google offers GMail with, wait for it, 1GB of storage. I’m still amused that people are so impressed with 1GB, and as I’ve said before this is hardly going to be enough for most people in the log run anyway. But disk space is cheap, so 1GB is not really impressive, its just more than other providers. But I digress. Why don’t they offer a hosted web site service with entry level available resources of 10GB of RAM (yes you read that correctly) so that you can provide stateful web sites.
I’m checking one of my more database intensive apps and its looking at around 30MB of resources (in Task Manager) when loaded. So if I had 10GB of resources available I could run over 300 of these sessions. Up the resources to 100GB of RAM and that’d be over 3000 sessions.
But RAM is expensive. I know. At around $400 per GB (in Australia) that would be $4000 for my 10GB option and $40,000 for the 100GB option. (These figures are very simplictic I know, and just the RAM, they don’t include the extra hardware and power costs.)
But we spend tens of $,000s on development time writing code to manage state.
Now I’m not seriously thinking you could convince your CTO to pay big $ for a google hosted site, so the model, for google to offer it would have to have some benefit to them. Hello advertising again. Yes, sadly it seems they are the only ones who can make any money out of advertising, so perhaps that is an option. Maybe there are better ways to benefit from it, I’m not sure.
The bottom line is I want stateful web sites. And I don’t think it would be that hard. When we finally get them, we’ll look back at the stateless days and shake our heads.
Just as today we cringe when the old timer talks about his days using punch cards, we’ll be the old timers that talk about the days of stateless web sites.