Good questions, Grant.
Using a database will give you more lexibility with regards to organizing,
filtering, and querying the data. However, DataSets and DataTables have the
capability to filter and sort data without looping. And a database consumes
more resources to use, as well as being slower. So, whether to use a
database or an in-memory data source is pretty much dependent upon what you
want to do with the data.
Now, as to where to cache in-Memory data, you have basically 2 choices
(simplifying the explanation): Application Cache or Session. Application
Cache is shared across all Sessions and Pages. Session Cache is shared
across all pages for a single client Session. So, if the data is not
user-specific, Application Cache is the way to go with regards to an
in-memory cache, as there is only one copy of the data consuming memory for
the lifetime of the App.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
"Grant Merwitz" <gr***@workshare.com> wrote in message
news:eP**************@TK2MSFTNGP14.phx.gbl...
Hi
I am currently weighing up two options.
I have a data i need available for my website.
However, this data is only available via a web service and too slow to
retrieve on a user request basis.
So i plan once a day load to download this data. Either into the Cache, or
a local database i'll set up.
I would like to know what the better method would be,
We're talking about 1000 records, 20 fields (none to large). So really,
not a large amount of data.
Now i think Cache would be quicker. But this data needs to be searched and
filtered.
So would it be wiser to have the database setup as this may be quicker to
filter
Or is it just as efficient to loop through say a DataTable in memory?
What's the best method here?
Also, if the Cache is the way to go, whats the best way to store it -
dataset, datatable, hash table, arraylist etc.
And are there better ways of searching these than looping through them?
TIA - this would be a great help