问题描述
我想创建一个微服务来并行处理我通过Azure Service Bus通过push
获得的某些任务.如果任务成功完成,此微服务将通知Azure服务总线.请参见下图:
I want to create a micro-service for parallel processing some tasks which I get via push
by an Azure Service Bus. This micro-service will notify the Azure Service Bus if the task where complete with success or not. See the following diagram:
我已经考虑了以下三个选项:
I already have this three options to consider:
- 托管服务
- Azure Web作业
- 天蓝色批次
由于先决条件之一就是该微服务必须位于.NET Core 3中,因此是否有使用Web作业代替托管服务的有效理由?哪个选项可确保鲁棒性和可扩展性?
Since one of the requisites is that this micro-service need to be in .NET Core 3, is there any valid justification to use Web Jobs instead of Hosted Services? Which of the options guarantee robustness and scalability?
推荐答案
基于我在Azure云上进行并行处理的知识,并考虑您的方案,有以下三种解决方案作为候选选项,我认为足够好,如下所示.
Based on my knowledge for parallel processing on Azure cloud and consider for your scenario, there are three solutions as candidate options which I think be good enough, as below.
-
Azure Web作业.如我所知,Azure仅支持连续WebJobs在Azure WebApp的多实例上运行,如下图文档
Run Background tasks with WebJobs in Azure App Service
,其可伸缩性取决于Azure App Service的层数和应用程序实例的数量.此选项的性能有限,不适用于真正的并行计算的情况.
Azure Web Jobs. As I known, Azure only supports Continuous WebJobs to run on multi-instances of Azure WebApps, as the figure below from the document
Run Background tasks with WebJobs in Azure App Service
, its scalability is up to the tier of Azure App Service and the number of app instances. This option has limited performance, is not suitable for the scenario of real parallel computing.
Azure Batch,Azure云上真正的大规模并行和高性能计算(原因除外,HDInsight).但是,如果没有繁重的数据处理任务,那么执行一些只需要多线程中的并发功能的任务就太昂贵了.
Azure Batch, the real large-scale parallel and high-performance computing on Azure cloud (of cause, except HDInsight). However, if there is not heavy data processing tasks for you, it's too expensive to do some tasks which just need concurrent feature within multi-threads.
带有Service Bus触发器的Azure功能,请参考官方文档 Azure Service Bus bindings for Azure Functions
.真正的无服务器架构是为您的微服务方案设计的.它对横向扩展和最大实例功能的限制如图所示(来自文档 Azure Functions scale and hosting
)在 host.json
文件.
Azure Functions with Service Bus Trigger, please refer to the offical document Azure Service Bus bindings for Azure Functions
. A real serverless architecture is designed for microservice scenario as yours. Its limitation for the feature of scale out and max instances as the figure (comes from the document Azure Functions scale and hosting
) below be defined in host.json
file.
因此,如果不是真正的并行数据处理方案,我建议使用Azure Functions,否则Azure Batch是并行大数据任务的最佳选择. Azure WebJobs只能使用Azure App Service托管您的网站并运行具有连续作业的并行任务,但是性能有限.以我的观点来看,托管服务可根据多线程内基于Webhook请求的并发任务进行处理,
So if not real parallel data processing scenario, I recommended Azure Functions, otherwise Azure Batch is the best choice for parallel big data tasks. Azure WebJobs can only use Azure App Service to host your web site and run parallel task with continous jobs, but just have limited performance. Hosted services as my view, to handle concurrent tasks based on webhook requests within multi-threads, not recommended.
这篇关于工人-无法选择最佳技术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!