A retail company is designing a serverless architecture for a new inventory management system. The architecture must support two workloads:
1. A public-facing REST API that serves product catalog details, which experiences unpredictable traffic spikes and must minimize costs by scaling to zero during idle periods.
2. A nightly batch synchronization job that updates inventory levels from an external warehouse database, which runs to completion, takes up to 45 minutes to execute, and requires a custom runtime environment.
To minimize administrative overhead and runtime hosting costs, which hosting configuration should you recommend?
- Azure Functions on a Consumption plan to host the REST API, and Azure Container Apps Jobs to run the nightly synchronization jobAnswer
- BAzure Functions on a Consumption plan to host both the REST API and the nightly synchronization job
- CAzure Kubernetes Service (AKS) to host both the REST API and the nightly synchronization job as containerized workloads
- DAzure Functions on a Consumption plan for the REST API, and Azure Functions on a Consumption plan with the host.json timeout set to 60 minutes for the nightly synchronization job
Answer
Azure Functions on a Consumption plan to host the REST API, and Azure Container Apps Jobs to run the nightly synchronization job
The correct architecture uses Azure Functions on a Consumption plan for the REST API, as it scales to zero during idle periods and scales out automatically to handle unpredictable traffic spikes. For the nightly synchronization job, Azure Container Apps Jobs is the optimal choice because it is designed for run-to-completion tasks, allows executions up to 24 hours, scales to zero when not running, and requires low administrative management compared to hosting Kubernetes clusters.
Step-by-Step Solution
Key Concept
Selecting appropriate serverless hosting options based on execution time limits, scaling characteristics, and operational overhead.