Theoretical question as to datasets

  • Thread starter Thread starter Earl
  • Start date Start date
E

Earl

Datasets are often referred to as an "in-memory database" or database
representation. I'm curious how much of the database most applications do or
should carry in memory? I tend to use a conservative approach, loading a
table or subsets of tables into the dataset whenever I load a form and then
clear that data when exiting the form. I'd be interested to hear how others
handle use of the dataset.
 
Earl said:
Datasets are often referred to as an "in-memory database" or database
representation. I'm curious how much of the database most applications do or
should carry in memory? I tend to use a conservative approach, loading a
table or subsets of tables into the dataset whenever I load a form and then
clear that data when exiting the form. I'd be interested to hear how others
handle use of the dataset.

That's sounds about right. I think that in general you should have one
DataSet for each Use Case, or each discreet user transation. For instance,
for an order entry process you might load one customer, and all the related
orders and correspondence history into a DataSet. Use that data to drive
one or more related forms as the user completes the process, and then apply
all the changes to the database.

In addition for your small mostly static tables, you can load them entirely
into DataSets at application startup.

David
 
Hi Earl,

I'm designing an app where i keep about 5 small tables (~30 records) in
memory because i use them a lot and they almost never change. Using the
DataTable.Filter and DataConnector.Filter speed up the app with just a
little memory penalty (compared to what the app is consuming).
If a table is likely to be remote and you need to query some small tables
that will probably not change, and if they change it would not be a problem
i would keep them in memory. Tables like MediaType()= {DVD},{VHS},{CD}...

After adding a mediatype the app whill say 'You have to restart the app
to....'
 
Thanks David. The only difference is that I use one global dataset for the
entire app and manipulate the tables and table structures as needed (tip of
the hat to Bill Ryan for that pointer).
 
Back
Top