One more difference for the mix and for completeness; management of parallel activities.
With durable fan out/fan in you have a lot of built in management control.
Firstly, you can control the number of parallel processes easily with configuration in your host.json
file, and secondly you can manage/monitor the progress of parallel activities with the management API.
The first can be helpful when you are accessing a resource that has limitations, such as a throttled API, so it is not inundated with too many requests or exceeds the efficiency of the API to handle parallel requests. The following hosts.json
example limits the durable tasks to 9 concurrent activities:
{
"version": "2.0",
"functionTimeout": "00:10:00",
"extensions": {
"durableTask": {
"hubName": "<your-hub-name-here",
"maxConcurrentActivityFunctions": 9
},
"logging" : {
...
}
}
This will name your hub & limit concurrent activities.
Then for instance management you can query and terminate activity instances as well as send them messages and purge the instance history. This kind of functionality can be really useful if you need to know when activities have completed, especially if you need to know the success/fail status of each completed activity. This helps to reliably start downstream processes that rely on all activities being completed. Retries were mentioned by @Thiago; when using the built in retry mechanism the management API really comes into it's own to monitor running activities. It can be really useful in building solid resilience and handling down stream processes.
https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-instance-management?tabs=csharp
https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-task-hubs?tabs=csharp
https://joonasw.net/view/how-azure-durable-functions-scale