开发者

Sharing information between applications

My question is very simple to expose:

I have a few aplications that share data between then. I need a way to support that data sharing (cross several computers) and when one aplication changes data, others should be notified about that.

My ques开发者_StackOverflow社区tion is about what tecnologies could be usefull to me. The solution i realise at this moment is to have a database to share data and an external publish-subscribe system (like http://pubsub.codeplex.com/) to notify all applications when the data is changed. But i belive that could exist some helpfull solutions.

Do you know any of then? Thanks.


Hmm, watch out when committing to an architecture like this, they never work well in practice. The first problem is the large amount of network traffic you'll create, that never scales well. More seriously, you'll run into huge concurrency problems. By definition, the "data changed" notification will be delivered late and there's no guarantee they'll be ordered. Everything works well as long as there is a long enough time delay between notifications, giving the sub-systems the chance to have a synchronized view of the data.

But that house of cards comes crashing down hard when the load increases and notifications start getting buffered. A sub-system will start making decisions on old views of the data and get out of sync with the views held by other sub-systems. Nothing you can do about it either, you cannot "lock" across a network. And extremely hard to debug, the sync mismatches are completely random and spurious.

Pursue a centralized server approach, concurrency is much easier to deal with.


If you are using Java, JMX comes to mind Sun's JMX tutorial. There is a lot of support for it and easy to use.


You can use Windows Communication Foundation (WCF) to communicate between clients and a server. The communication can be two ways, so the client can notify the server about a change, and the server will push out a message to all the relevant clients that need to get notified. A two way communication is called a Duplex Contract in WCF. That way, you don't have to use a database if you don't really need one.


I can use Sql Server to store my data and Sql Server Notification Services ( http://msdn.microsoft.com/en-gb/library/ms172483(SQL.90).aspx ) to get notifications when data is changed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜