In-process model vs isolated worker model

What is the difference between the In-process model and the isolated worker model

ModelDescription
Isolated worker modelThe Code you are running is running independant of the Host environment of the Function (Explanation and advantages are listed below)
In-process modelWith this model, the function and the host are running on the same process

Understand the difference

The In-process is being decomissioned by Microsoft by end of 2026! Therefore you should use the Isolated worker model in any way, but still I find it interesting to understand the difference between the two models Microsoft is offering or has offered, depending when you are reading this.

In-Process model

This model runs the function code inside the same runtime as the host of the function. There are some problems or sources of problems which might occur in this case.

  1. Shared memory:
    • Both environments share the same memory
    • Communication between both parties are shorter, as they don't need to cross process
  2. Dependency Coupling
    • The code must be compatible with the host's environment and dependencies
    • So if the host uses dotnet 6 and the code is using dotnet 8, it won't work. Both need the same dotnet sdk
  3. Performance:
    • As already mentioned in point number 1, the in-process model is faster due to the fact that there is no need for seperate processes. This is also visible in the performance of the application. It might be only a small difference, but there might be offering
  4. Stability Risk:
    • If the function crashes, the whole environment will crash

Isolated Worker model

This model is the exact opposite of the in-process model. Here the host and the function communicate via inter-process communication. In this case there are 2 main points to check:

  1. Isolation: When the function crashs, the host will not fail
  2. Flexibility: Different .NET versions can be used

That isolation and flexibility is highly important becuase one host can run multiple functions.