By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,564 Members | 810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,564 IT Pros & Developers. It's quick & easy.

Cached vs Local Database - advice please

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Nov 19 '05 #2

P: n/a
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.

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:u0**************@TK2MSFTNGP10.phx.gbl...
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


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.