WCF and Concurrent usage throttling
Have a requirement to interface with a legacy system that exposes a set of web services. The legacy system is not terribly fast and there are concerns by the client that it cannot handle excessive load. It seems to handle the current load ok, but we have been tasked with writing a system which will interface directly with the legacy system and potentially increase that load substantially. I can neither confirm nor deny the legacy systems ability to handle our projected load as the metrics simply are not available and its not feasible to generate them at this time.
So, the design decision is to implement our system such that it only allows a certain amount of requests through to the legacy system.
To do this, I have adopted a Unit of Work approach to the legacy system and will create a WCF service that acts as the system gateway (and no, it wont be strict Unit of Work pattern, but the concept is identical).
The service gateway will be exposed via a named pipe binding and it will use a serviceThrottling service behavior to limit the number of concurrent requests to the required number deemed "manageable" by the legacy system.
I like this approach because it means WCF can deal with the concurrency regulation, and I am sure it would do a better job than me at queuing and managing the requests. Its pretty simple, and also pretty fast. The named pipe binding is extremely high performing and the design of a service boundary now, means it will be trivial to expose this to other clients in the future using other bindings such as wsHttpBinding.