Success/Error Branching
I have a process flow that needs to update records in a MS Server DB and have set it up so that successful records go down one branch and have their own SQL statement to perform the update and errors go down another path.
Is this design ok or would it be better to not use a branch and instead have a handlebars condition to determine which SQL statement to issue?
Is there a difference in performance in either design?
0
Comments
Steven Smith either way is fine. As for which is faster, it would depend on your connection concurrency, page size, and how many errors you'll actually get.
Let's say you have a branch in your flow, you connection has a concurrency of 2, your export has 1 page, and that page has 20 records. If you have 10 records fail, one branch gets 1 page with 10 records and the other branch gets 1 page with 10 records. So you end up with 2 pages of data. Since concurrency for imports process a page of data, this could theoretically be faster to finish all records because you have 2 threads processing 10 records each vs 1 thread processing 20 (if you were to use handlebars). If instead of 20 records on one page, you make it 2500 records per page and half still fail, you can see where splitting the page between different branches would be beneficial.
That being said, having a branch would add very minimal overhead because it has to evaluate each record on the page and then re-page the data to send each record down the correct branch.
Please sign in to leave a comment.