Requirements:
- A time triggered background process to insert a record to a database table.
- Runs over 10,000 requests every 00:00 (midnight)
- Individual requests wouldn't last 1-2 seconds
We are planning to use two azure functions for this, steps below:
- The 1st Azure Function (time triggered), runs a query then insert records to an azure storage queue.
- New queue items will be picked up the 2nd Azure Function (queue trigger)
QUESTION: Is it okay to use Azure Function purely for API calls? for functions mentioned in 1. and 2. they would call an api, which contains the domain layer for select and insert operations.
Architecture looks like this:
Azure Function -> (http call) -> Api -> Application Service -> Domain Layer -> Data Layer
My thoughts are, functions won't be able to scale since the load will just be transferred to the api, not unless the api also scales with some sort of load balancing