Challenge: Applying Fan-Out and Fan-In Orchestration

Test your understanding of fan-out and fan-in orchestration in durable functions.

Overview

In this challenge, you’ll apply fan-out orchestration in a durable function. You will do so by optimizing the logic in the existing orchestrator.

Requirements

In the setup below, we have a durable function that represents an ETL script. First, retrieve user IDs. Then, for each user, retrieve data from the database, transform it, and save it in another database.

The database-specific actions are emulated. User IDs are just arbitrary integers, while the ETL activity function emulates a computationally intensive process by waiting one second. However, this setup is sufficient to demonstrate its inefficiency. Perform the following tasks:

  • Apply fan-out orchestration to make the process more efficient.

  • Apply fan-in orchestration to aggregate the results.

Applying fan-out orchestration

Currently, the ETL activities run one after the other, which might take a long time. You need to make them run in parallel.

Applying fan-in orchestration

Once all ETL activities are executed, count the successful executions (i.e., the ones that return the UserDataEtlStatus with the status of Success) and pass them to the RecordSuccessCount function that logs the count.

Get hands-on with 1200+ tech skills courses.