Calling multiple azure function and combine the response

DevBuster007 181 Reputation points
2020-11-07T15:32:05.167+00:00

I was going through durable function concepts and it's really cool. especially fan out, fan in pattern.
I have a requirement where i am making calls to multiple API's then combine these results in single response.

For example: To get customer info of a bank, i need to make a call to

AccountInfo API
Credit Card API
Loan API

Account Response should contain the data from all these API's.
I know i can make a call to all these API's in a single function. Wondering if durable function could be a better solution here?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,605 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JayaC-MSFT 5,526 Reputation points
    2020-11-10T14:15:17.893+00:00

    @DevBuster007 Durable Functions is an extension of Azure Functions that lets you write stateful functions in a serverless compute environment. You can use durable functions if you need to implement workflows, run activities in parallel, workflow has dependency on some external process etc. However, you need to keep in mind that Orchestrator functions and activity functions are both managed by internal queues so you can expect some latency ( refer to the performance details )
    For durable function patterns , you may consider the fan out/ fan in pattern if you need to execute one or more functions in parallel and send out the aggregated output.
    Having said that, you can always make a call to all these API's in a single function, but that depends on the complexity and requirement of your project.
    In case you are considering durable function, if the APIs are executed quickly then you may want to try Http apis : https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-http-features?tabs=csharp#consuming-http-apis
    in case of long running ones , please check : https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-instance-management?tabs=csharp#wait-for-orchestration-completion

    Please let me know if this makes sense and helps. If yes, please don't forget to "accept the answer" and "up-vote" so that it could help others with similar issues.

    1 person found this answer helpful.
    0 comments No comments