I have hosted a rest api as a proxy layer in .net core 3.1 which shall receive 40K requests per hour. Here, a single request travels like this within the code:
i. Check data in static storage
ii. If not, call(getasync) another api using httpclient—>
iii. Parse the returned json response using json deserialize async
iv. Fill data in static storage
v. Validate data if request is authentic—>
If success from Authentication middleware then call Authorization Middleware—>
If auth policy matches then call Controller Action—>
i. Call(getasync) one more api using httpclient—>
ii. Return the data to the requestor came from api.
As it is shown that each step is depending on the previous one. There is no step where I can do something before the completion of previous step like fire and forget.
In such case, should I use async/await as this comes with a cost of adding IAsyncStateMacine. Please suggest?