We are in the process of setting up new project. Our requirements is to invoke multiple rest API's and aggregate the response and send it back to mobile client.
We are exploring these 2 options for our experience layer(Integration ) 1. Logic Apps 2. Azure Function
We have observed one major difference with respect to performance between these two.
We run through simple use case to compare the performance.
we are just invoking a rest API to get some metrics with different options available
- Just integrate with APIM as back-end service
- Using Azure Function
- Using Logic Apps
Logic app is taking longer time for execution compare to other options. Below is the simple logic app to invoke rest api
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"GetReferenceData": {
"inputs": {
"headers": {
"Authorization": "@variables('AuthToken')"
},
"method": "GET",
"uri": "url"
},
"runAfter": {
"Initialize_AuthToken": [
"Succeeded"
]
},
"type": "Http"
},
"Initialize_AuthToken": {
"inputs": {
"variables": [
{
"name": "AuthToken",
"type": "string",
"value": "@{triggerOutputs()['headers']?['Access-Token']}"
}
]
},
"runAfter": {},
"type": "InitializeVariable"
},
"Response": {
"inputs": {
"body": "@body('GetReferenceData')",
"statusCode": "@outputs('GetReferenceData')['statusCode']"
},
"kind": "Http",
"runAfter": {
"GetReferenceData": [
"Succeeded"
]
},
"type": "Response"
},
"Response_2": {
"inputs": {
"body": "@body('GetReferenceData')",
"statusCode": "@outputs('GetReferenceData')['statusCode']"
},
"kind": "Http",
"runAfter": {
"GetReferenceData": [
"Failed",
"Skipped",
"TimedOut"
]
},
"type": "Response"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"storageLocation": {
"defaultValue": [],
"type": "Array"
}
},
"triggers": {
"manual": {
"inputs": {
"method": "GET",
"relativePath": "/referenceData",
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {}
}
We have so many use cases where we need to invoke the multiple rest API's and aggregate the result. With the above numbers it seems Function App is doing a way better job than Function App.For parallel operations i may rely upon durable functions over Logic apps.
So i just want to understand why logic app is taking longer time almost double time compared to function for the similar operation?
Is logic app is not meant for these operations?