Hi All,
I'm relatively newbie to ASP.NET, and just building my second realtime webapplication.
When I was learning ASP.NET a year back, I have been told "It is costlier to connect and grab data from database, so make as much less connection as possible and re-use the retrieved data effectively". The reasons given are
- A connection to the DB server first needs to be established.
- The concurrent connections on DB server will be less compared to IIS.
- Use disconnected architecture so that connection can be closed soon (ofcourse other flexibilites are also there) etc, etc.
And when my study expanded, I learnt other measures of storing data once retrieved from DB, across postbacks. But now, I'm learning one by one that they are costlier than connecting to DB. like...
- Session Variables : Memory size bubbles with number of users
- View State : The process of encryption and travel makes it costlier.
- Application Variables : Not so useful in all circumstances.
- Cache : (I know them, but not used them till now).
Also Oflate, I'm repeatedly advaised not to store retrieved tables in session, view state etc., but to connect to DB and grab it afresh on each postback.
And viewing this in light of SQL Server based Session State management, where the Framework itself used DB to store session. I feel, I should unlearn my initial learning and perception about database connectivity.
What do you say ???
Any other suggestions / tips are also welcome.
Thanks