I’m trying to design a webapplication for 10.000 users daily. Some of basic parts, such as todays question/polls etc. will change automatically once a day (just to give you an example of the “problem”).
To keep the code as static as possible, I would like to keep the poll/questions outside the HTML files.
I was thinking, since its only a single question or two, I could easly store the form-data in a single string somewhere.
My choices are:
- Application variable, letting every users “session” read from the Application[“todays_question”]
- Read from text file, again letting every users “session” init with data from this line of text.
- SQL could ofcause also be used, but I think thats pure overkill, connecting and initializing a whole database for 1 single record in a single table.
So my question is, which would have the least webserver impact?
- Application variables, are they slow or fast?
- Reading a file from filesystem sounds slow, but is it?
- Using an SQL for a static site (which would mean a SQL instance locally to keep the speed up) sounds rather slow to me too.
Have I overseen the “true fast version”?
I have thought of putting the actual form into some sort of static javascript plugin, but I still need the server validation and thats where the performance issue comes into my mind.
You can also use a static global variable for very fast retrieval. So, load your data from file, dbase or whatever at application start level (global.asax) and store it in a static global variable for very speedy retrieval from “anywhere” in your application. This is described as “best practice”.
For more info : http://www.dotnetperls.com/global-variables-aspnet