Cached vs Local Database - advice please

  • Thread starter Thread starter Grant Merwitz
  • Start date Start date
G

Grant Merwitz

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
 
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.
 
Thanks for your advice.

I think the database is the way to go.
Considering the request to build this project came from marketing and
therefore is like to be ever changing - as they can never make up there
minds.

I think fexibility if definately the better option here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top