Having a WCF service with InstanceContextMode of Single and ConcurrencyMode Multiple

I am hosting a WCF service in windows service.
I need to cache data and share it across all clients.

I also have a few operations which could take in various parameters and return data.

The question is should I create two services one with Instance mode single for the cached data and then another service with per call for all the operations that take parameters.

Or would this one service be handle mutliple requests without waiting for the current reuest from one or more clients to be completed.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Miguel OzSoftware EngineerCommented:
Just have one web service along with caching the results as shown in link below:
Note: You need to evaluate how big your data is and for how long you need it to be on the cache.
countrymeisterAuthor Commented:
Hi Mas_oz@003

I read that article, nowhere in that article it mentions what the Concurrency mode or the InstanceMode of the service should be.
The behavior I see currently while testing, when I set my service as SIngle and Concurrency mode is Multiple, on the first call I still have to go to the db to get the data, when I have verified that the wcf service has the data cached.
Miguel OzSoftware EngineerCommented:
The article is about how to use memory cache in WCF which is independent of which InstanceContextMode you use.

Depending on your needs I will go for InstanceContextMode = InstanceContextMode.Percall and use the cache. It is flexible and escalable (ti does not block when a method call is processed because every WCF instance will look after the call)
An explanation on when to use the different InstanceContextMode  is here.

Note: You can use Single and use variables to save the info you need to cache, but this solution is not as flexible as memory cache + the service is not escalable. (Meaning this one instance will serialize 9executed one at the time) any WCF calls as there is only one instance) servicing them

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.