Azure Container Registry (ACR) - Time & Space Complexity
When working with Azure Container Registry, it's important to understand how the time to push or pull container images changes as the image size or number of images grows.
We want to know how the number of operations or API calls increases when handling more or larger container images.
Analyze the time complexity of pushing multiple container images to Azure Container Registry.
az acr login --name myRegistry
for image in images:
docker push myregistry.azurecr.io/$image
This sequence logs into the registry once, then pushes each container image one by one.
Identify the API calls, resource provisioning, data transfers that repeat.
- Primary operation: Pushing each container image to the registry.
- How many times: Once per image in the list.
Each additional image requires a separate push operation, so the total work grows as more images are added.
| Input Size (n) | Approx. Api Calls/Operations |
|---|---|
| 10 | 10 push operations |
| 100 | 100 push operations |
| 1000 | 1000 push operations |
Pattern observation: The number of push operations grows directly with the number of images.
Time Complexity: O(n)
This means the time to push images grows linearly as you add more images.
[X] Wrong: "Pushing multiple images happens all at once, so time stays the same no matter how many images."
[OK] Correct: Each image push is a separate operation that takes time, so more images mean more total time.
Understanding how operations scale with input size helps you design efficient cloud workflows and explain your reasoning clearly in interviews.
"What if we pushed images in parallel instead of one by one? How would the time complexity change?"