DataSet is good for ASP.NET?

  • Thread starter Thread starter Quentin Huo
  • Start date Start date
Q

Quentin Huo

Hi,

According to some people, DataSet is good for the N-Tier Aapplication
because it maks the logic layer seperated from the database. But a DataSet
object will be assigned a block of memory to keep the data. If there is a
dataset object created in an aspx page and this page will be accessed by
many visitors (at the same time), is it possible the performance of the
server will be reduced?

Thanks

Q.
 
Yes, the DataSet does take up space in memory, but there are several reasons
why this can still be the best way to go....

If you expect high volume and the data doesn't change very often, you can
cache the DataSet so that only one copy is in memory and no trips to the
database need to take place.

If the data does change frequently, then you have 2 options...

Use OutputCaching to store different DataSets based on parameters passed to
the page...Still no trips to the database and the benefits of caching.

Even if the initial page request must go to the database, storing the data
in a DataSet will eliminate the need to make additional calls to the
database, which is a good trade off for storing the DataSet in memory.
 
Back
Top