WCF for a shared data access

Posted by Audrius on Stack Overflow See other posts from Stack Overflow or by Audrius
Published on 2010-03-22T10:17:46Z Indexed on 2010/03/22 11:01 UTC
Read the original article Hit count: 574

Filed under:
|
|

Hi all,

I have a little experience with WCF and would like to get your opinion/suggestion on how the following problem can be solved:

A web service needs to be accessible from multiple clients simultaneously and service needs to return a result from a shared data set. The concrete project I'm working on has to store a list of IP addresses/ranges. This list will be queried by a bunch of web servers for a validation purposes and we speak of a couple of thousand or more queries per minute.

My initial draft approach was to use Windows service as a WCF host with service contract implementing class that is decorated with ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple) that has a list object and a custom locking for accessing it. So basically I have a WCF service singleton with a list = shared data -> multiple clients. What I do not like about it is that data and communication layers are merged into one and performance wise this doesn't feel "right".

What I really really (- want is Windows service running an instance of IP list holding container class object, a second service running WCF service contract implementation and a way the latter querying the former in a nice way with a minimal blocking. Using another WCF channel would not really take me far away from the initial draft implementation or would it?

What approach would you take? Project is still in a very early stage so complete design re-do is not out of question.

All ideas are appreciated. Thanks!

UPDATE: The data set will be changed dynamically. Web service will have a separate method to add IP or IP range and on top of that there will be a scheduled task that will trigger data cleanup every 10-15 minutes according to some rules.

UPDATE 2: a separate benchmark project will be kicked up that should use MSSQL as a data backend (instead on in-memory list).

© Stack Overflow or respective owner

Related posts about c#

Related posts about web-services