Skip to content

Commit 0dbc8df

Browse files
committed
Significant updates to main article
1 parent a66165c commit 0dbc8df

File tree

1 file changed

+72
-38
lines changed

1 file changed

+72
-38
lines changed

articles/azure-functions/durable/durable-task-scheduler/durable-task-scheduler.md

Lines changed: 72 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,85 @@ ms.subservice: durable
1010

1111
# Azure Functions durable task scheduler backend for durable functions (preview)
1212

13-
The Azure Functions durable task scheduler is a fully managed backend for durable function apps. It's built from scratch and provides several key benefits not available in the "bring your own (BYO)" backend options today. This document discusses different aspects of the managed backend including architecture, concepts, and key features.
13+
The Azure Functions durable task scheduler is a fully managed backend for durable function apps. It provides several key benefits not available in the "bring your own (BYO)" backend options for durable functions today. This document discusses different aspects of the managed backend including architecture, concepts, and key features.
1414

1515
For an in-depth comparison between the supported storage providers for durable function apps, see the [storage providers](../durable-functions-storage-providers.md) documentation.
1616

1717
## Architecture
1818

19-
The durable task scheduler is designed from the ground up to be the fastest and most efficient backend for durable functions. The scheduler resource has its own dedicated compute and memory resources optimized for:
19+
Instances of the durable task scheduler can be created using Azure Resource Manager and are of type [Microsoft.DurableTask/scheduler](microsoft.durabletask/schedulers). Each *scheduler* resource internally has its own dedicated compute and memory resources optimized for:
2020

2121
- Dispatching orchestrator, activity, and entity work items
2222
- Storing and querying history at scale with minimal latency
23-
- Providing a rich monitoring experience through the durable task scheduler dashboard
23+
- Providing a rich monitoring experience through the durable task scheduler dashboard.
24+
25+
Unlike the BYO storage providers, the durable task scheduler provider is a purpose-built backend-as-a-service optimized for the specific needs of the Durable Task Framework.
26+
27+
The following diagram shows the architecture of the durable task scheduler backend and its interaction with connected apps.
2428

2529
:::image type="content" source="media/durable-task-scheduler/architecture.png" alt-text="Diagram of the durable task scheduler architecture.":::
2630

27-
Unlike other generic storage providers, durable task scheduler is a purpose-built backend-as-a-service optimized for the specific needs of the Durable Task Framework. Durable task scheduler does the heavy lifting of work item dispatching, partition management, and other tasks typically handled internally by the BYO backends running in the app process (like the Azure Functions host). As a result, durable apps using durable task scheduler run with less overhead.
31+
### Separation of concerns
2832

29-
## Feature highlight
33+
The durable task scheduler runs in Azure as a separate resource from the app. This separation allows the scheduler to scale independently of the app and provides better isolation between the two components. This isolation is important for several reasons:
3034

31-
> [!NOTE]
32-
> The following features are available at the current stage of public preview with more under way. To report problems or request new features, submit an issue in the [durable task scheduler repository](https://aka.ms/dts-samples).
35+
- **Reduced resource consumption**: BYO storage providers can consume a significant amount of CPU and memory resources. This resource consumption is due to the overhead of managing partitions and other complex state store interactions. By using a managed scheduler instead of a BYO storage provider, your app instances can run more efficiently and with less resource contention.
36+
37+
- **Fault isolation**: Stability or availability issues in the durable task scheduler will not affect the stability or availability of your connected apps. With BYO storage providers, instability in the backend provider (which is a complex component) can create instability in the app logic. By separating the scheduler from the app, you can reduce the risk of cascading failures and improve overall reliability.
38+
39+
- **Independent scaling**: The scheduler resource can be scaled independently of the app, allowing for better infrastructure resource management and cost optimization. For example, multiple apps can share the same scheduler resource, improving overall resource utilization. This capability is especially useful for organizations with multiple teams or projects that require durable functions.
40+
41+
- **Improved support experience**: The durable task scheduler is a managed service, which means that Azure can provide better support and diagnostics for issues related to the scheduler. When using a BYO storage provider, you might need to troubleshoot issues related to the backend provider, which can be complex and time-consuming. A managed service allows Azure to take care of the underlying infrastructure and provide a more streamlined support experience.
42+
43+
### App connectivity
44+
45+
Your durable function apps connect to the scheduler resource via a gRPC connection. The endpoint address is in the form `{scheduler-name}.{region}.durabletask.io`. For example, `myscheduler-123.westus2.durabletask.io`. The connection is secured using TLS and the app's identity is used to authenticate the connection.
46+
47+
Work items are streamed from the scheduler to the app using a push model, removing the need for polling and improving end-to-end latency. Your apps can process multiple work items in parallel and will send responses back to the scheduler when the corresponding orchestration, activity, or entity task is complete.
3348

34-
### Managed by Azure
49+
### State management
3550

36-
Unlike other [existing storage providers](../durable-functions-storage-providers.md) for durable functions, the durable task scheduler offers dedicated resources that are fully managed by Azure. You no longer need to bring your own storage account for storing orchestration and entity state, as it is built in.
51+
The scheduler manages the state of orchestrations and entities internally. It doesn't require you to provide a separate storage account for state management. The internal state store is highly optimized for use with durable functions, allowing for better performance and reduced latency compared to BYO storage providers.
3752

38-
Since Azure has direct access to your app's backend, it also becomes easier to diagnose and resolve problems related to durable task scheduler so users can expect a better support experience.
53+
The scheduler internally uses a combination of in-memory and persistent storage to manage state. The in-memory store is used for short-lived state, while the persistent store is used for recovery and for multi-instance query operations. This bespoke design, heavily inspired by the [Netherite storage architecture](https://www.vldb.org/pvldb/vol15/p1591-burckhardt.pdf), allows the scheduler to provide low-latency access to state while still ensuring durability and reliability.
54+
55+
## Feature highlights
56+
57+
> [!NOTE]
58+
> The following features are available at the current stage of public preview with more under way. To report problems or request new features, submit an issue in the [durable task scheduler GitHub repository](https://aka.ms/dts-samples).
3959
4060
### Durable task scheduler dashboard
4161

42-
When a scheduler resource is created, a corresponding dashboard is provided out-of-the-box. The dashboard provides an overview of all orchestrations instances and allows you to quickly filter by different criteria. You can easily gather data about an orchestration instance, such as status, duration, input/output, etc. You can also drill into an instance to get data about sub-orchestrations and activities. The dashboard displays data related to Durable Entities as well.
62+
When a scheduler resource is created, a corresponding dashboard is provided out-of-the-box. The dashboard provides an overview of all orchestrations and entity instances and allows you to quickly filter by different criteria. You can easily gather data about an orchestration instance, such as status, duration, input/output, etc. You can also drill into an instance to get data about sub-orchestrations and activities.
4363

44-
Aside from monitoring purposes, you can also perform ad hoc management operations on the dashboard, such as pausing, terminating, or restarting an orchestration instance. See [Debug and manage orchestrations using the durable task scheduler dashboard](./durable-task-scheduler-dashboard.md) for more details.
64+
Aside from monitoring, you can also perform management operations on the dashboard, such as pausing, terminating, or restarting an orchestration instance. For more information about the dashboard, see [Debug and manage orchestrations using the durable task scheduler dashboard](./durable-task-scheduler-dashboard.md).
4565

46-
[Access to the dashboard](./develop-with-durable-task-scheduler.md#accessing-dts-dashboard) is secured by identity and role-based access.
66+
[Access to the dashboard](./develop-with-durable-task-scheduler.md#accessing-dts-dashboard) is secured by identity and role-based access controls.
4767

48-
### Supports the highest throughput
68+
### Multiple task hubs
4969

50-
The durable task scheduler was benchmarked against other storage providers, including the Azure Storage, MSSQL, and Netherite providers. The results show the durable task scheduler provides better throughput than the other options.
70+
Durable function state is durably persisted in a *task hub*. A [task hub](../durable-functions-task-hubs.md) is a logical container for orchestration and entity instances and provides a way to partition the state store. One scheduler instance allows for the creation of multiple task hubs, each of which can be used by different apps. Access to a task hub requires that the caller's identity has the required role-based access control (RBAC) permissions.
5171

52-
The following table shows the results of a series of benchmarks ran to compare the relative throughput of the durable task scheduler provider vs. the default Azure Storage provider. The Azure Storage provider was chosen as the comparison because it's by far the most commonly used backend option for durable function apps.
72+
Creating multiple task hubs allows you to isolate different workloads and manage them independently. For example, you can create a task hub for each environment (dev, test, prod) or for different teams within your organization. Creating multiple task hubs in a single scheduler instance is also a way to reduce costs, as you can share the same scheduler resources across multiple task hubs. However, task hubs under the same scheduler instance share the same resources, so if one task hub is heavily loaded, it might affect the performance of the other task hubs.
73+
74+
### Emulator for local development
75+
76+
The [durable task scheduler emulator](./quickstart-durable-task-scheduler.md#set-up-dts-emulator) is a lightweight version of the scheduler backend that runs locally in a Docker container. It allows you to develop and test your durable function app without needing to deploy it to Azure. The emulator provides a local version of the management dashboard, so you can monitor and manage your orchestrations and entities just like you would in Azure.
77+
78+
By default, the emulator exposes a single task hub named `default`. You can expose multiple task hubs by specifying the `DTS_TASK_HUB_NAMES` environment variable with a comma-separated list of task hub names when starting the emulator. For example, to enable two task hubs named `taskhub1` and `taskhub2`, you can run the following command:
79+
80+
```bash
81+
docker run -d -p 8080:8080 -e DTS_TASK_HUB_NAMES=taskhub1,taskhub2 mcr.microsoft.com/dts/dts-emulator:latest
82+
```
83+
84+
> [!NOTE]
85+
> The emulator internally stores orchestration and entity state in local memory, so it isn't suitable for production use.
86+
87+
## Work item throughput
88+
89+
The durable task scheduler was benchmarked against other storage providers, including the Azure Storage, MSSQL, and Netherite providers. The results show the durable task scheduler provides better work item throughput than the other options, which translates into more orchestrator, entity, and activity tasks being processed in a given time period.
90+
91+
The following table shows the results of a series of benchmarks ran to compare the relative throughput of the durable task scheduler provider vs. the default Azure Storage provider. The Azure Storage provider was chosen as the comparison because it's currently the default and most commonly used backend option for durable function apps.
5392

5493
:::image type="content" source="media/durable-task-scheduler/performance.png" alt-text="Bar chart comparing throughput of durable task scheduler vs Azure Storage providers.":::
5594

@@ -60,7 +99,7 @@ To test the relative throughput of the backend providers, these benchmarks were
6099

61100
The intent of the benchmark is to measure the overhead of each backend without doing anything too complicated. This type of sequential orchestration was chosen due to its commonality in function apps that include durable functions.
62101

63-
#### Test details
102+
### Test details
64103

65104
The test consists of the following criteria:
66105

@@ -69,7 +108,7 @@ The test consists of the following criteria:
69108
- The same app was used for all storage providers, and the only change was the backend storage provider configuration.
70109
- The test is triggered using an HTTP trigger which starts **5,000 orchestrations concurrently**.
71110

72-
After the test is triggered, the throughput is calculated by dividing the total number of orchestrations completed by the total time taken to complete them. The test was run multiple times for each storage provider configuration to ensure the results were consistent.
111+
After the test completes, the throughput is calculated by dividing the total number of completed orchestrations by the total execution time. The test was run multiple times for each storage provider configuration to ensure the results were consistent.
73112

74113
This benchmark showed that the durable task scheduler is roughly **five times faster** than the Azure Storage provider. Your results might vary depending on:
75114

@@ -81,35 +120,30 @@ This benchmark showed that the durable task scheduler is roughly **five times fa
81120
> [!NOTE]
82121
> These results are meant to provide a rough comparison of the relative performance of the storage provider backends at the time the test was run. These results shouldn't be taken as definitive.
83122
84-
### Supports multiple task hubs
123+
## Limitations and considerations
85124

86-
Durable function state is durably persisted in a *task hub*. A [task hub](../durable-functions-task-hubs.md) is a logical container for orchestration and entity instances and provides a way to partition the state store. One scheduler instance allows for the creation of multiple task hubs, each of which can be used by different apps. Access to a task hub requires that the caller's identity has the required RBAC (role-based access control) permissions.
125+
- **Supported hosting plans**: The durable task scheduler currently only supports durable functions running on *Functions Premium* and *App Service* plans. For apps running on the Functions Premium plan, you must [enable the *Runtime Scale Monitoring* setting](./develop-with-durable-task-scheduler.md#auto-scaling-in-functions-premium-plan) to get auto scaling of the app.
87126

88-
Creating multiple task hubs allows you to isolate different workloads and manage them independently. For example, you can create a task hub for each environment (dev, test, prod) or for different teams within your organization. Creating multiple task hubs in a single scheduler instance is also a way to reduce costs, as you can share the same scheduler resources across multiple task hubs. However, task hubs under the same scheduler instance share the same resources, so if one task hub is heavily loaded, it may affect the performance of the other task hubs.
127+
The *Consumption*, *Flex Consumption*, and *Azure Container App* hosting plans aren't yet supported when using the durable task scheduler.
89128

90-
### Emulator for local development
91-
92-
The [durable task scheduler emulator](./quickstart-durable-task-scheduler.md#set-up-dts-emulator) is a lightweight version of the scheduler backend that runs locally in a Docker container. It allows you to develop and test your durable function app without needing to deploy it to Azure. The emulator provides a local version of the management dashboard, so you can monitor and manage your orchestrations and entities just like you would in Azure.
129+
- **Available regions**: Durable task scheduler resources can be created in a subset of Azure regions today. You can run the following command to get a list of the supported regions:
93130

94-
Without any additional configuration, the emulator exposes a task hub named `default`. You can enable additional task hubs by specifying the `DTS_TASK_HUB_NAMES` environment variable with a comma-separated list of task hub names when starting the emulator. For example, to enable two task hubs named `taskhub1` and `taskhub2`, you can run the following command:
131+
```bash
132+
az provider show --namespace Microsoft.DurableTask --query "resourceTypes[?resourceType=='schedulers'].locations | [0]" --out table
133+
```
95134

96-
```bash
97-
docker run -d -p 8080:8080 -e DTS_TASK_HUB_NAMES=taskhub1,taskhub2 mcr.microsoft.com/dts/dts-emulator:latest
98-
```
135+
Consider using the same region for your durable functions app and the durable task scheduler resources. Having these resources in different regions might impact performance and limit certain network-related functionality.
99136

100-
> [!NOTE]
101-
> The emulator internally stores orchestration and entity state in local memory, so it isn't suitable for production use.
137+
- **Scheduler quota**: You can currently create up to **five schedulers per region** per subscription.
102138

103-
## Considerations
139+
- **Feature parity**: Some features might not be available in the durable task scheduler backend yet. For example, at the time of writing, the durable task scheduler doesn't support the following features:
104140
105-
- **Scaling**: If your durable functions app is not reaching the maximum throughout of the durable task scheduler, consider *scaling out* your app to more instances as the bottleneck might lie in the number of workers available to run orchestrations. If scaling out also doesn't achieve the throughput you need, then consider *scaling up* your compute resources. In the future, you'll also be able to scale out the resources allocated to a durable task scheduler by purchasing more [capacity units](./dts-dedicated-sku.md#dedicated-sku-concepts).
106-
- **Supported hosting plans**: The durable task scheduler currently only supports durable functions running on *Functions Premium* and *App Service* plans. For apps running on the Functions Premium plan, [enable the *Runtime Scale Monitoring* setting](./develop-with-durable-task-scheduler.md#auto-scaling-in-functions-premium-plan) to get auto scaling of the app.
107-
- **Available regions**: Durable task scheduler is only available in certain Azure regions today. Run this command to get the latest supported regions:
141+
- [Orchestration rewind](../durable-functions-instance-management#rewind-instances-preview)
142+
- [Extended sessions](../durable-functions-azure-storage-provider#extended-sessions)
143+
- [Management operations using the Azure Functions Core Tools](../durable-functions-instance-management#azure-functions-core-tools)
108144
109-
`az provider show --namespace Microsoft.DurableTask --query "resourceTypes[?resourceType=='schedulers'].locations | [0]" --out table`.
110-
111-
Consider picking the same region for your durable functions app and the durable task scheduler as having these resources in different regions may impact performance and limit certain network-related functionality.
112-
- **Scheduler quota**: You can create up to **five schedulers per region** per subscription today.
145+
> [!NOTE]
146+
> Feature availability is subject to change as the durable task scheduler backend approaches general availability.
113147
114148
## Next steps
115149

0 commit comments

Comments
 (0)