Skip to content

Commit 8de08db

Browse files
JoshVanLmsfussellmarcduiker
authored
[1.16] Adds workflow limitations (#4865)
* [1.16] Adds workflow limitations Updates state store table to include supported stores. Adds a warning emoji to state stores which have workflow limitations. Adds workflow limitation sections to the cosmosDB & dynamodb setup docs. Signed-off-by: joshvanl <[email protected]> * Updates limitation sections. Remove localizations Signed-off-by: joshvanl <[email protected]> * Apply suggestions from code review Co-authored-by: Mark Fussell <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> * Adds section on the number of records that are saved by workflow shape Signed-off-by: joshvanl <[email protected]> * Mark dynamo and cosmosdb state stores as not supporting workflows in table Signed-off-by: joshvanl <[email protected]> * Update daprdocs/content/en/reference/components-reference/supported-state-stores/setup-azure-cosmosdb.md Signed-off-by: Mark Fussell <[email protected]> * Apply suggestions from code review Co-authored-by: Mark Fussell <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> * Adds production warning to cosmos & dynamo Signed-off-by: joshvanl <[email protected]> * Removes warning from state template Signed-off-by: joshvanl <[email protected]> * Update daprdocs/content/en/reference/components-reference/supported-state-stores/setup-azure-cosmosdb.md Signed-off-by: Mark Fussell <[email protected]> * Update daprdocs/content/en/reference/components-reference/supported-state-stores/setup-dynamodb.md Signed-off-by: Mark Fussell <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> Signed-off-by: Mark Fussell <[email protected]> Co-authored-by: Mark Fussell <[email protected]> Co-authored-by: Marc Duiker <[email protected]>
1 parent d84cd60 commit 8de08db

File tree

7 files changed

+52
-6
lines changed

7 files changed

+52
-6
lines changed

daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,20 @@ Similarly, if a state store imposes restrictions on the size of a batch transact
175175
Workflow state can be purged from a state store, including all its history.
176176
Each Dapr SDK exposes APIs for purging all metadata related to specific workflow instances.
177177

178+
#### State store record count
179+
180+
The number of records which are saved as history in the state store per workflow run is determined by its complexity or "shape". In other words, the number of activities, timers, sub-workflows etc.
181+
The following table shows a general guide to the number of records that are saved by different workflow tasks.
182+
This number may be larger or smaller depending on retries or concurrency.
183+
184+
| Task type | Number of records saved |
185+
| ----------|-------------------------|
186+
| Start workflow | 5 records |
187+
| Call activity | 3 records |
188+
| Timer | 3 records |
189+
| Raise event | 3 records |
190+
| Start child workflow | 8 records |
191+
178192
## Workflow scalability
179193

180194
Because Dapr Workflows are internally implemented using actors, Dapr Workflows have the same scalability characteristics as actors.

daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-overview.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ Want to skip the quickstarts? Not a problem. You can try out the workflow buildi
116116

117117
## Limitations
118118

119-
- **State stores:** Due to underlying limitations in some database choices, more commonly NoSQL databases, you might run into limitations around storing internal states. For example, CosmosDB has a maximum single operation item limit of only 100 states in a single request.
119+
- **State stores:** You can only use state stores which support workflows, as [described here]({{% ref supported-state-stores %}}).
120+
- Azure Cosmos DB has [payload and workflow complexity limitations]({{% ref "setup-azure-cosmosdb.md#workflow-limitations" %}}).
121+
- AWS DynamoDB has [workflow complexity limitations]({{% ref "setup-azure-cosmosdb.md#workflow-limitations" %}}).
120122

121123
## Watch the demo
122124

daprdocs/content/en/reference/components-reference/supported-state-stores/setup-azure-cosmosdb.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,22 @@ This particular optimization only makes sense if you are saving large objects to
225225

226226
{{% /alert %}}
227227

228+
## Workflow Limitations
229+
230+
{{% alert title="Note" color="primary" %}}
231+
232+
As described below, CosmosDB has limitations that likely make it unsuitable for production environments.
233+
There is currently no path for migrating Workflow data from CosmosDB to another state store, meaning exceeding these limits in production will result in failed workflows with no workaround.
234+
235+
{{% /alert %}}
236+
237+
The more complex a workflow is with number of activities, child workflows, etc, the more DB state operations it performs per state store transaction.
238+
All input & output values are saved to the workflow history, and are part of an operation of these transactions.
239+
CosmosDB has a [maximum document size of 2MB and maximum transaction size of 100 operations.](https://learn.microsoft.com/azure/cosmos-db/concepts-limits#per-request-limits).
240+
Attempting to write to CosmosDB beyond these limits results in an error code of `413`.
241+
This means that the workflow history must not exceed this size, meaning that CosmosDB is not suitable for workflows with large input/output values or larger complex workflows.
242+
A general guide to the number of records that are saved during a workflow executon can be found [here]({{% ref "workflow-architecture.md#state-store-record-count" %}}).
243+
228244
## Related links
229245

230246
- [Basic schema for a Dapr component]({{% ref component-schema %}})

daprdocs/content/en/reference/components-reference/supported-state-stores/setup-dynamodb.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,20 @@ $ aws dynamodb get-item \
158158
}
159159
```
160160

161+
## Workflow Limitations
162+
163+
{{% alert title="Note" color="primary" %}}
164+
165+
As described below, DynamoDB has limitations that likely make it unsuitable for production environments.
166+
There is currently no path for migrating Workflow data from DynamoDB to another state store, meaning exceeding these limits in production will result in failed workflows with no workaround.
167+
168+
{{% /alert %}}
169+
170+
The more complex a workflow is (number of activities, child workflows, etc.), the more state operations it performs per state store transaction.
171+
The maximum number of operations that can be performed by DynamoDB in a [single transaction is 100](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/transaction-apis.html).
172+
This means that DynamoDB can only handle workflows with a limited complexity, meaning it is not suitable for all workflow scenarios.
173+
A general guide to the number of records that are saved during a workflow executon can be found [here]({{% ref "workflow-architecture.md#state-store-record-count" %}}).
174+
161175
## Related links
162176

163177
- [Basic schema for a Dapr component]({{% ref component-schema %}})

daprdocs/data/components/state_stores/azure.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
transactions: true
3131
etag: true
3232
ttl: true
33-
workflow: false
33+
workflow: true
3434
- component: Azure Table Storage
3535
link: setup-azure-tablestorage
3636
state: Stable

daprdocs/data/components/state_stores/generic.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
transactions: true
5353
etag: true
5454
ttl: true
55-
workflow: false
55+
workflow: true
5656
- component: Hashicorp Consul
5757
link: setup-consul
5858
state: Alpha
@@ -140,7 +140,7 @@
140140
transactions: true
141141
etag: true
142142
ttl: true
143-
workflow: false
143+
workflow: true
144144
- component: PostgreSQL v1
145145
link: setup-postgresql-v1
146146
state: Stable
@@ -195,7 +195,7 @@
195195
transactions: true
196196
etag: true
197197
ttl: true
198-
workflow: false
198+
workflow: true
199199
- component: Zookeeper
200200
link: setup-zookeeper
201201
state: Alpha

daprdocs/data/components/state_stores/oracle.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
etag: true
1010
ttl: true
1111
query: false
12-
workflow: false
12+
workflow: true
1313
- component: Coherence
1414
link: setup-coherence
1515
state: Alpha

0 commit comments

Comments
 (0)