WCF Pub / Sub with Subscriber Caching

Problem: How to provide a distributed, scalable, and disaster resistant pub / sub service with WCF.

Details:

Please note that this approach is being considered in addition to messaging / middleware solutions such as Tibco EMS.

I am looking at WCF, especially how it can be used to create pub / sub. This article is very good on this topic: WCF pub-sub .

In the article, the author tries to solve the problem of having multiple publishers (as, for example, with a service level scaled in several blocks). The problem is that if client A registers with publisher A and publisher B wants to publish the event, then publisher B will not know about client A. i.e. no one has told publisher B that client A wanted to receive notification of events. The author offers pub / sub service as a solution. The pub / sub service will centrally store subscriptions. However, if I wanted pub / auxiliary services resilience to be stable if you have a secondary / double pub / auxiliary service, I have the same original problem.

So, I think there are several solutions to the problem:

  • Store subscriber data in a distributed cache (see questions: q1 and q2 ).
  • Save subscriber data in the database / central file system.

Can anyone think of any other solutions (i.e. I haven't missed some fantastic WCF magic feature?) Any comments are appreciated.

+7
c # architecture wcf disaster-recovery
source share
2 answers

I had the same problem and researched this problem a lot. The problem is actually simple. You want to maintain some centralized state, but in a distributed way. I found that the best way to achieve this is to use a distributed cache. Look at speed, for example. I do not know which WCF own solution can solve the problem of public administration. I even looked at the long-lived services in which state management is carried out by WCF, however it is not suitable for the pub / auxiliary service, because the state should be centralized for all client connections. Storing data in a database is also an option, but the cost is the need for a database, and even with a database you can have one point of failure if the database is not clustered, that is, several computers.

In the end, I realized that it’s actually expensive to implement something with zero points of failure, and if you decide to go there, then take a look at Azure, the future of the storage is in the cloud, Azure services will be fully scalable and distributed, but we still not located.

+3
source share

I think WCF just does not exist. You need a broker who processes all these details for you, so that you can simply implement your business logic. There are some very good ones like ActiveMQ. If you need orchestration, you probably want to use a bus that can also sit on top of a broker. I think WCF is great, but trying to turn it into something that is not is not a good idea.

0
source share

All Articles