Durable Functions are an extension of Azure Functions that lets you write stateful functions in a serverless environment. The extension manages state, checkpoints, and restarts for you.
The extension lets you define stateful workflows using an orchestrator function, which can provide the following benefits:
- You can define your workflows in code. No JSON schemas or designers are needed.
- Other functions can be called both synchronously and asynchronously. Output from called functions can be saved to local variables.
- Progress is automatically checkpointed when the function awaits. Local state is never lost when the process recycles or the VM reboots.
Durable Functions are amazing but only when implemented correctly.
Below are the things you should be avoiding when implementing durable functions:
- Create your activity functions to perform one independent task.
- Implement detailed logging inside activities and orchestrators. It’s very hard to find the current state of a request if not using logs.
- For a single request, always connect your logging with the task ID. It becomes easier to track the progress in application insights.
- Always use a dedicated storage for your function app. Do not use single storage for multiple function apps to save money.
If not implemented correctly, durable functions work very slow , however they provide high reliability in terms of processing a request but may give bad performance if not implemented correctly.