2.4 - Scaling and load balancing

Cloud+ CV0-004 objective 2.4 covers scaling and distributing workloads. An auto-scaling group automatically adds or removes instances based on demand rules, so capacity tracks load and you avoid paying for idle servers. A load balancer spreads incoming client requests across several backend servers for scale and resilience; a Layer 7 (application) load balancer routes based on HTTP host and URL path rather than IP and port, enabling content-based routing. For safe releases, a canary deploy releases to a small percentage such as 5% of users, watches metrics, then widens the rollout if all looks healthy. You should also know horizontal versus vertical scaling and health checks. Expect scenario questions that describe elastic capacity, distributing requests, app-aware routing or a cautious phased release, and ask which construct - auto-scaling, load balancer, Layer 7 or canary - fits.

Memory hook
Add/remove instances on demand = auto-scaling group. Spread requests across servers = load balancer. Route by HTTP host/path = Layer 7. Release to ~5%, watch, then widen = canary deploy.

Practice questions

1. Which component spreads incoming client requests across several backend servers?

  • NAT gateway
  • Load balancer (correct answer)
  • Bastion host
  • CDN edge

A load balancer distributes traffic across healthy backends (round-robin, least-connections). A NAT gateway provides outbound access; a bastion is a jump host.

2. Which construct automatically adds or removes instances based on demand rules?

  • Placement group
  • Auto-scaling group (correct answer)
  • Resource group
  • Availability set

An auto-scaling group launches/terminates instances against metrics (CPU, queue depth) to match demand and save cost. A resource group is just an organizational container.

3. Which load balancer type routes based on HTTP host and URL path rather than IP and port?

  • Layer 4 (transport)
  • Layer 7 (application) (correct answer)
  • Layer 2 (data link)
  • Layer 3 (network)

A Layer 7 load balancer inspects HTTP data (host header, path, cookies) to route requests. A Layer 4 balancer only sees IP addresses and ports, so it is faster but less aware.

4. A load balancer sends each new request to the backend with the fewest active connections. This algorithm is:

  • Round-robin rotation
  • Source IP hash mapping
  • Least connections (correct answer)
  • Weighted random pick

Least connections routes to the server currently handling the fewest sessions, balancing uneven or long-lived requests better. Round-robin ignores current load.

5. Before migrating, comparing current capacity against required capacity to find shortfalls is a:

  • Gap analysis (correct answer)
  • Load test
  • Penetration test
  • Cost forecast

A gap analysis compares the current state to the target state to reveal missing capacity, skills or controls before migration. A load test only measures performance under stress.

6. To let a load balancer route a returning user to the same backend, you enable:

  • Round-robin
  • Session affinity (correct answer)
  • Cross-zone spread
  • Connection draining

Session affinity (sticky sessions) pins a client to one backend, useful when session state is stored locally. Round-robin ignores affinity and can break local sessions.

Related objectives