Azure Webjobs: One Job with several Functions, or several Jobs with 1 function each?

房东的猫 提交于 2019-12-09 15:25:18

问题


How do I decide between creating several WebJobs with 1 function each and bundling several functions into one or only a few WebJobs? Thanks


回答1:


There is no straight answer to your question. Sorry.

Usually you group functions by workflow or role. For example if you have a workflow that contains a function that resizes an image, then a function that applies a watermark and another one that replicates the images then it makes sense to put all the functions together because they are related. You are more likely to change all of them when you modify the flow.

On the other hand, you might argue that functions should be separated. Unless you change the input/output, there is no reason to modify more than one function. However, if you need to change more than one function, you will end up editing more projects.

As you see, both arguments have pros/cons and there is really no right answer.

Try to experiment and see which approach works better for your solution.

PS: The only guideline that I can give is: if the functions are really small (a few lines of code), probably it is easier to put them in the same webjob because there is quite some overhead in maintaining multiple assemblies.



来源:https://stackoverflow.com/questions/26785874/azure-webjobs-one-job-with-several-functions-or-several-jobs-with-1-function-e

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!