Question

Difficulty: MediumServerless and Web Application Hosting

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?

  1. Azure Functions on a Consumption plan to host the REST API, and Azure Container Apps Jobs to run the nightly synchronization jobAnswer
  2. B
    Azure Functions on a Consumption plan to host both the REST API and the nightly synchronization job
  3. C
    Azure Kubernetes Service (AKS) to host both the REST API and the nightly synchronization job as containerized workloads
  4. D
    Azure 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

1
Analyze the scaling and cost requirements for the REST API workload.
The REST API requires rapid scaling to handle traffic spikes and the ability to scale to zero to minimize idle hosting costs. Azure Functions on a Consumption plan perfectly matches these requirements.
Azure Functions Consumption plan is billed only when functions are running and scales automatically based on incoming events.
2
Evaluate the constraints of the nightly synchronization job.
The synchronization job runs for up to 45 minutes and is a run-to-completion batch task.
This duration exceeds the 10-minute maximum execution limit of the Azure Functions Consumption plan, ruling it out.
3
Select the optimal hosting option for the long-running batch job that minimizes costs and administrative overhead.
Azure Container Apps Jobs is designed specifically for transient, run-to-completion tasks, can run up to 24 hours, and charges only for the duration of execution, meaning zero baseline costs when idle.
Unlike AKS, which requires significant cluster management, or Dedicated/Premium App Service plans, which incur constant baseline costs even when idle, Azure Container Apps Jobs provides a serverless model with minimal administrative overhead.

Key Concept

Selecting appropriate serverless hosting options based on execution time limits, scaling characteristics, and operational overhead.
Rate this question