Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Function Apps with fewer Functions or few Function Apps with lots of Functions?

We are currently deploying a single Function App per environment / per region in Azure. These Function Apps contain lots of Functions inside them. With the Service Plan set to consumption and therefore dynamic we are fairly happy with this as it reduces the operational complexity in our ARM templates.

We do wonder though, if it would be best to have more "function apps" per environment and spread our functions across them?

Is there any real benefit to doing this as we are under the impression performance will be scaled by the dynamic service plan?

like image 454
Jordan Avatar asked Nov 29 '16 22:11

Jordan


1 Answers

Jordan,

The answer to the question would really depend on the type of workloads you're handling with your functions.

Although the scale controller will handle scaling to meet demand, functions within a Function App do share resources on each instance, and a resource intensive (either memory or CPU) may impact other functions in the same app.

There is also no process isolation between functions in the same Function App. They all run in the same process (except for some of the scripting languages like Python, Batch, etc) and in the same App Domain. So if isolation is a factor (for reasons like security, dependency management, shared state, ect.), you may want to consider splitting functions into different apps.

Versioning and deployment is another factor worth considering, as the unit of deployment is a Function App (and not the individual functions)

With that said, if you're not running into resource consumption issues with your workloads and the issues mentioned above are not a concern, as you pointed out, running multiple functions in a single function app significantly simplifies management, so I wouldn't change that approach if there's no need to do so.

I hope this helps!

like image 109
Fabio Cavalcante Avatar answered Oct 21 '22 15:10

Fabio Cavalcante