Click here to Skip to main content
15,445,242 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi Guys,

i need your help to understand a performance /scalability problem.

I have to mantain a web-application that runs only in the society network, the application is an "approval workflow manager" and it is used also to store documents.

The framework is 4.0, the language is C#, the server is a sql2005 server

The application has about 500 users, and usually i think no more then 100 user at the same time.

I'm facing a problem with translations, the situation i found is a sql table for the translation, and in the base-page 's code behind a recoursive functions that look for every controls and change the description of the text with the one in the sql.

Well every page load so make requests for the same "string" every time,
so i decided to store the whole translation table in session
Note: the table count 3 language, less than 1000 translation so 3.000 at total.
Note 2: i'm developing right now the system to keep only the actual language so the total amount of data could become 1.000 rows

do you think that could be paintfull to store 3000 records in session with 100 users online ?

could store in Cache be a better solution ?

any other smart idea ? :D

bye bye
Updated 14-May-12 22:10pm
Sandeep Mewara 15-May-12 11:58am    
Is this shared across users?
nrgjack 15-May-12 12:44pm     CRLF
well just to understand, every text on buttons, every label every grid header are translated. so the translation are more or less always the same for every user, but the new ones that i introduce in every "patch/release" i tried in test environement and it was very easy to make the change, i used the httpcontext.session and now i use httpcontext.application. i'll test in theese few days but the solution sounds great till now. i provide an administration page to clear and restore the translation so i can refresh the translation every time i need, that was a thing that scared me about cache. anyway thanks a lot

Since the translation table would be shared by all users, if I understood you correctly, why not store the table inside the Application object instead of the Session object. Then there would be only one instance. If there is some integer key to your translation table and the content is always fetched via this key you could also read all of your data into a Dictionary<int, String> for fast retrieval.

Hope that helps!


Share this answer
nrgjack 15-May-12 9:31am    
thanks you, application is a good choiche, it is quite easy to switch from session to application (indeed i was using a propertie that get and set value from/to session now i'll try application, thanks ^_^
Sandeep Mewara 15-May-12 11:59am     CRLF
Just read your answer. After reading your answer, it does now sounds like having it shared across users. If so, this is the right one. Will 5 it as it sounds more of across users now as I read more n more. Will update my answer. :doh:
3000 records in session with 100 users online
That does sounds too much of data in a session at a given time.

I would go with Cache - it would be better option here.

Have a read of the following:
MSDN: ASP.NET Caching: Techniques and Best Practices[^]
Cache Management in ASP.NET[^]

After reading Manfred answer and then question again, it does sounds like sharing a data across user. In that case, Application variables fit the bill best.
Share this answer
nrgjack 15-May-12 9:34am     CRLF
thank you, very interesting topics, i'm worried about updating cache (rarely). do you think cache would be a better approach event compared to Application object ? why? thanks regards
Sandeep Mewara 15-May-12 11:55am     CRLF
Application objects hold data that can be shared across session across users. I thought you are not looking for that. Are you? Read here: MSDN: ASP.NET State Management Overview[^] State management in ASP.NET - 1[^]
nrgjack 15-May-12 12:46pm     CRLF
thanks for your help too , i appreciated it a lot, i'll study the link you posted :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900