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 6342495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:15:06+00:00 2026-05-24T20:15:06+00:00

I have webservice(WCF) and MembershipProvider/RoleProvider to check credentials. When service called – various methods

  • 0

I have webservice(WCF) and MembershipProvider/RoleProvider to check credentials.

When service called – various methods call providers to get user, get login name by Id, get Id by login name and so on. End result – When looking in Profiler – I can see lot of chat.

I can easily incorporate caching into MembershipProvider and RoleProvider’s so it will cache user’s and won’t hit DB every time.

User list is not big. I don’t think it will ever be more than 100-200.

On one hand – I know SQL Server does cache small tables and designed to take care of those selects. OTOH – I SEE it in profiler 🙂 And memory on web server side will be occupied. Plus, lookups on web server still need to be done (CPU/Memory).

I guess I want to hear about your experience and should I even worry about this stuff? I placed tags “strategically” so hopefully both DBA and developers will give me some input 🙂

  • 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-05-24T20:15:07+00:00Added an answer on May 24, 2026 at 8:15 pm

    Absolutely, avoiding a round trip to the DB server pays off. Is not only the memory cache issue. Running a query, even a trivial one, is quite a complex process:

    • the connection has to be opened and authenticated. It gets amortized with connection pooling, true, but even a pooled connection still requires one extra roundtrip for sp_reset_connection at open time.
    • request has to be composed and sent to the server
    • a task needs to be allocated for the request and a worker has to pick up the task. workers are very precious resource in SQL Server, as there are so few of them.
    • SQL has to parse your query. At the very very best it can skip the parsing but still needs to hash the input text, see Dynamically created SQL vs Parameters in SQL Server
    • query has to be executed, locks acquired, pages in memory looked up. Locking is especially expensive because it may conflict with other operation and has to wait. Using snapshot isolation can help to some (large) extent.
    • the result has to be marshaled back to client.
    • client has to parse the response metadata.
    • client has to process the response.

    An local in memory lookup will win most times. Even a remote cache lookup like memcached will win over a DB query, no matter how trivial the query. So why not always cache locally? Because of the one of the most hard problems in CS: cache coherency and invalidation. It is a problem that is way harder than you think it is right now, no matter how hard you think it is ;). You may look at SQL Server’s own active cache invalidation solution, Query Notifications, which works pretty well for fairly static result sets. I have a LINQ integration with Query Notification project myself, LinqToCache.

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

Sidebar

Related Questions

Im working on a Web-Application (MyWebApp). I have a Service-Reference to a WCF-Webservice. The
I have a WCF webservice that is hosted in IIS 7.5. Inside the Service
I'm trying to call a WCF Webservice, from a dll I have made, running
I currently have a WCF service that exposes a SOAP enpoint. In this webservice
I have a WCF webservice that caters simultaneous requests from different clients. The service
I have created a WCF webservice using WCF Service Application template in VS 2008.
I have a WCF webservice that has the following service contract [ServiceContract(Namespace = http://example.org)]
I have developed a WCF WebService. On client side they are unable to send
I have a mobile app webservice client that connects to a WCF webservice(on my
I have C# Client application calling Windows webservice written in WCF calling Sql Procedure

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.