Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 295
Nestor Avatar asked Nov 06 '14 17:11

Nestor


1 Answers

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.

like image 97
Victor Hurdugaci Avatar answered Nov 16 '22 02:11

Victor Hurdugaci