简体   繁体   English

Azure Service Bus主题/订阅配额和缩放

[英]Azure Service Bus Topic/Subcription Quotas and Scaling

My application is required to publish messages to thousands of clients with high throughput requirements (hundreds of, maybe 1000+ messages per second) in order to keep local client databases in sync with the server database. 我的应用程序需要将消息发布到成千上万个具有高吞吐量要求的客户端(每秒可能有数百条,可能超过1000条消息),以使本地客户端数据库与服务器数据库保持同步。 Every server database operation would potentially require a message to be published to a location of 20 or less clients. 每个服务器数据库操作都可能需要将一条消息发布到20个或更少客户端的位置。 Clients only have database information for their particular location. 客户端仅具有其特定位置的数据库信息。 Thousands of locations exist. 存在数千个位置。

My idea was to use Azure Service Bus topic/subscription model for this. 我的想法是为此使用Azure Service Bus主题/订阅模型。 Each client would establish a subscription (and connection) to the database sync topic and receive filtered messages for their location. 每个客户端将建立对数据库同步主题的订阅(和连接),并接收有关其位置的已过滤消息。

However, according to the Azure Service Bus Quota page , I am limited to the following: 但是,根据“ Azure服务总线配额”页面 ,我仅限于以下情况:

  • Number of concurrent connections on a namespace - 1,000 名称空间上的并发连接数-1,000
  • Number of concurrent connections on a queue/topic/subscription entity - Capped by the limit of concurrent connections per namespace. 队列/主题/订阅实体上的并发连接数-以每个名称空间的并发连接数限制。
  • Number of subscriptions per topic - 2,000 每个主题的订阅数-2,000

With these limitations now in mind, my solution does not seem usable. 考虑到这些限制,我的解决方案似乎无法使用。 What is the best approach to solving this problem using Azure Service Bus? 使用Azure Service Bus解决此问题的最佳方法是什么? To get around the subscriptions per topic limit I could just create a topic per location. 为了解决每个主题的订阅限制,我可以仅在每个位置创建一个主题。 However, the killer really is the number of concurrent connections on a topic/namespace (I think). 但是,杀手really实际上是主题/名称空间上并发连接的数量(我认为)。 All clients would be subscribed and long-polling for sync messages to come down from each topic and that would be thousands. 将订阅所有客户端并进行长轮询,以使同步消息从每个主题中传出,这将是数千个。 Would I need to create a new namespace and topic per location? 我是否需要在每个位置创建一个新的名称空间和主题? This seems problematic since I would have to open a new connection each time I want to publish from the server which is very frequent. 这似乎是有问题的,因为每次我要从服务器中发布时(每次都非常频繁),就不得不打开一个新连接。

Is Azure Service Bus not the correct solution for this problem? Azure Service Bus不是此问题的正确解决方案吗?

Not an expert, but a few points. 不是专家,而是几点。

Azure service bus does support long-polling: Azure Documentation . Azure服务总线确实支持长时间轮询: Azure文档 "As a solution architect/developer, you should consider using Service Bus queues when: Your solution must be able to receive messages without having to poll the queue. With Service Bus, this can be achieved through the use of the long-polling receive operation using the TCP-based protocols that Service Bus supports." “作为解决方案架构师/开发人员,您应该在以下情况下考虑使用服务总线队列:您的解决方案必须能够接收消息而不必轮询队列。对于服务总线,这可以通过使用长轮询接收操作来实现。使用Service Bus支持的基于TCP的协议。”

Also, you are correct: Event hubs are the reverse of your problem. 同样,您是正确的:事件中心是问题的反面。

Lastly, Azure notification hubs is actually the closest analog to your use case (it's designed for mobile push to thousands of endpoints, which is an extremely similar scenario). 最后,Azure通知中心实际上是与您的用例最接近的类比(它设计用于将移动推送到成千上万的端点,这是非常相似的情况)。 I am not sure if it's feasible to be used for non-mobile applications, but I have not yet found a reason why not. 我不确定将其用于非移动应用程序是否可行,但是我还没有找到不这样做的原因。 I am considering switching from topics when I have the time to research and POC notification hubs. 当我有时间研究和POC通知中心时,我正在考虑从主题切换。

Have you considered using Event Hubs? 您是否考虑过使用事件中心? https://msdn.microsoft.com/en-us/library/dn789973.aspx https://msdn.microsoft.com/en-us/library/dn789973.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM