If you understand correctly, you have several backends, possibly on separate computers. Then you have one "fontend" service, which basically acts as a proxy server for the backend, but is fully configurable in code. We do this fine tuning from multiple computers in a rack. Our interface is IIS7, the backend is a set of wcf services on multiple machines.
One, will it scale? Well, adding extra processing power to the backend is pretty simple, and writing load balancing code is not that bad either. For us, the problem was that the interface was bogged down, although it acted only as a proxy. In the end, we added a few more front-end computers, โbrokers,โ as you call them. It works very well. People suggested using Microsoft ForeFront for automatic load balancing, but I havenโt researched it yet.
Two, do I need to cache proxies? I would say, of course, yes, but that sucks. Sometimes these channels interrupt work. I have a thread that always runs in the background. Every 3 seconds it wakes up, checks all the services of wcf and wcf clients in the application. Any that are mistakenly destroyed and recreated.
check host channels: ...
while(true) { try{if(MyServiceHost.State!=System.ServiceModel.CommunicationState.Opened) {ReCreate();}} catch{} System.Threading.Thread.Sleep(3000); }
check client channels: ...
private static ChannelFactory<IMath> mathClientFactory = new ChannelFactory<IMath>(bindingHttpBin); while(true) { try { if(MyServiceClient.State==System.ServiceModel.CommunicationState.Faulted) { EndpointAddress ea = new EndpointAddress(ub.Uri); ch = WcfDynamicLan.mathClientFactory.CreateChannel(ea); } } catch{} System.Threading.Thread.Sleep(3000); }
On the client, I not only cache the channel, but also cache the ChannelFactory. This is just for convenience, but in order to make the code for creating a new channel shorter.