发布/订阅和基于内容的订阅 [英] Pub/Sub and Content-Based Subscriptions

查看:116
本文介绍了发布/订阅和基于内容的订阅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在设计一个系统,这将是事件驱动架构(基本的发布/订阅)的开始阶段。实际的工具和框架尚未被选择的是,所以这个问题是比技术更具体的概念(尽管它会在净完成)。

I am in the beginning phases of designing a system that will be event-driven architecture (basic pub/sub). The actual tools and frameworks have not been selected yet, so this question is more conceptual than technology specific (though it will be done in .Net).

一个近乎完美的类比的情况是金融交易系统。想象一下,在不断接受市场数据的服务器(实时或间隔 - 这并不重要)。服务器将发布定价更新特定证券。对于这个问题的目的,假设有1000个证券认为,服务器是看,并出版。

A nearly perfect analogy for the situation is a financial trading system. Imagine a server that is constantly receiving market data (in real time or at intervals--it doesn't matter). The server will publish pricing updates for specific securities. For the purpose of this question, let's say there are 1000 securities that the server is "watching" and publishing.

有100客户端应用程序的用户此服务。每个客户端将只关注正在发布证券的一小部分。

There are 100 client applications that are subscribers to this service. Each client would only be interested in a small subset of the securities that are being published.

如果客户端收到的所有1000证券报文,它就必须分析他们,这显然会产生更多的网络流量和更多的负载在客户端上。

If the client receives messages for all 1000 securities, it then has to parse them, which would obviously create more network traffic and more load on the client.

在另一方面,不必解析服务器端的邮件内容似乎发布/路由时增加负荷。

On the other hand, having to parse the message content on the server side would seem to add load when publishing/routing.

这是怎么通常这种类型的结构处理?

How is this normally handled in this type of architecture?

推荐答案

一般服务器都能够从事繁重的任务,更强大的机器。由于客户端只需要信息的子集,在我看来,服务器应解析信息,并只发送给他们所需要的客户信息。

Generally Servers are more powerful machines capable of doing heavy tasks. As the client only need the subset of information, in my opinion Server should parse the information and only send to client information they need.

这篇关于发布/订阅和基于内容的订阅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆