Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8121587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:32:35+00:00 2026-06-06T05:32:35+00:00

Possible Duplicate: Linq performance for in-memory collection I have a web application with around

  • 0

Possible Duplicate:
Linq performance for in-memory collection

I have a web application with around 1 million users. Almost every web page in that application calls the GetUser() method (to load first name in activity stream and other user details).
Right now I am hitting the database for each call, and I am thinking of caching all the users in memory and using Linq to fetch the search results or GetUser() from there.

My only issue is whether or not caching all users (in memory) is a good idea. Would I be wasting my RAM?
I personally think fetching from RAM is much faster than fetching from the DB (even if DB is optimized and indexed).

Note that I have already handled cache validation/updating/etc.

Does stackoverflow cache all its users?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:32:36+00:00Added an answer on June 6, 2026 at 5:32 am

    We did something similar, but instead of turning to Linq, we just installed a copy of SQL Server Express on each web server. We would push user data changes to each of the web servers, and the local app was using a middle tier and only pulling data from the local database periodically (but at least that was local, instead of everyone hitting the database).

    What technology you use for the caching, and how the app (or Linq) knows when to refresh its local copy, depends on how stale the cached data is allowed to be.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: LINQ to SQL: Return anonymous type? I have a standard LINQ to
Possible Duplicate: 'Contains()' workaround using Linq to Entities? Using LINQ in C#, I have
Possible Duplicate: Linq .Any VS .Exists - Whats the difference? Is there a performance
Possible Duplicate: Use Linq to Xml with Xml namespaces I have an xml: <?xml
Possible Duplicate: Conditional Linq Queries Using Entity Framework 4.0 I have a search condition
Possible Duplicate: How do I use LINQ Contains(string[]) instead of Contains(string) Suppose I have
Possible Duplicate: Parse XML Elements with LINQ I have an XML document that looks
Possible Duplicate: Asp.net how to correct the error I'm designing my web page using
Possible Duplicate: Linq - Top value form each group I have data in the
Possible Duplicate: To return IQueryable<T> or not return IQueryable<T> I have LINQ to SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.