DataBase vs Cache

V

vze1r2ht

I have a UserCollection that contains User objects that map to a User
table.

There could be potentially, 50-100K users in the table.

Should I load all the users into a Cache and just read/write from
there? (Everytime a write is made, it also writes to the DB). If I do
so, will it be memory efficient?


Also for filtering a collection, is there a way to have multiple
filters like DataTable.Select can?
Like very complex ones like (AND ID = 1 OR ID = 2) AND Admin = True etc.
 
M

Marina Levit [MVP]

That is a lot of data to store in the cache. And I'm not sure it is worth
it - it shouldn't be a lot of work to go to the user's table when you are
logging in a user or what not. And keeping the cache in sync with the
database would be a pain.

If you have multiple web servers at some point, now you have the problem of
keeping the other web server in sync.

And yes, you can use AND and OR in the DataTable.Select.
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top