SNA
SNA

Reputation: 7718

looking for a solution managing 1mb session data efficiently in asp .net

This question is about performance in .net. I have a project which shows 10,000 product information in a grid.

The .net project we have used HTML table to display information .At a time 500 records in a page is shown.And on click of the page numbers the relevant page information is shown.

Grid has actions ,delete ,group ,sort ,filter . To achieve this we are currently bringing all 10,000 product information from DB(this subtotal result is actually retrieved from 2 DB calls and 2 web service calls) and keep them in session ,and later retrieving the page wise data from session.each page is brought by ajax call-and each ajax call pick up the relevant page data from session -resultset

Now this has a huge performance hit in production where session is maintained in SQL server,

I am looking for a solution managing this result object(1mb data per user) efficiently. A call to service and db's to get each page data is again heavy.

Thanks SNA

Upvotes: 0

Views: 378

Answers (2)

jgauffin
jgauffin

Reputation: 101130

Sounds to me that you got these options:

  1. There is really no need to send all products to the user. Using ajax makes it really easy handle a lot of items without having to push all to the user.

  2. Store items client side. Cookies is not an option since they cannot store 1mb data. HTML5 got something called LocalStorage that you can use (but would then require that your users use a modern browser). Try LocalStorage here: http://www.quirksmode.org/html5/tests/storage.html

  3. Store the table server side. i.e. Load everything into the Application storage and only store keys in each session. You could also use an external cache (What are the advantages of Memcached compared to .NET Cache system?)

Upvotes: 0

Alexander Galkin
Alexander Galkin

Reputation: 12524

Do you really need to copy all 10,000 records from your database for every user? If these 10,000 are the more or less the same for every user, then you probably need to cache the data about products and store only the references to your cache (i.e. primary keys, memory addresses etc.)

What kind of information do you store in session apart from the product list? How many users do you have? Maybe you separate your data, using IIS in-memory sessions for most critical and often requested data and the rest put to your SQL Server or just to use IIS in-memory sessions (if your server has enough capacity for it).

And finally, if that doesn't help, then you probably need to change your SLA and decrease the number of products stored in user sessions, rather re-querying them from database on demand. That is not optimal, but maybe 90% of your users won't notice anything.

Upvotes: 3

Related Questions