Written by

Halkwinds Editorial Team

Halkwinds Research & Editorial

Published February 20, 2026
Blog image
Cloud

Cloud Networking Explained: VPCs, Load Balancers, and CDNs

A practical guide to designing resilient cloud network architectures — from VPC topology to global content delivery.

Cloud networking is the part of your infrastructure that nobody notices until it breaks. When a deployment goes smoothly, no one thanks the VPC. But when a misconfigured security group blocks a database connection, a misrouted load balancer sends traffic to a dead instance, or a CDN serves stale content to half your customers, the incident lands squarely on your engineering team. For engineering managers, understanding cloud networking is not about memorizing every CLI flag — it is about knowing enough to make sound architectural decisions, review designs critically, and avoid the expensive mistakes that surface only at scale. This guide walks through the three foundational building blocks — Virtual Private Clouds (VPCs), load balancers, and content delivery networks (CDNs) — and how they fit together into a resilient architecture.

  • Background / Why This Matters
  • Core Concepts and Architecture
  • Implementation Strategy
  • Scaling and Operational Considerations
  • Common Mistakes / What to Avoid
  • Frequently Asked Questions
  • Conclusion

Background / Why This Matters

In the on-premise era, networking was largely a hardware concern owned by a dedicated network operations team. Firewalls, switches, and routers were physical devices with physical cables. Cloud changed that. In platforms like AWS, Azure, and Google Cloud, the entire network is software-defined — which means your application developers now routinely make networking decisions, often without realizing they're doing so.

This shift is powerful but dangerous. A single line in a Terraform file can expose a production database to the public internet. A poorly designed subnet layout can force a painful re-architecture six months into a project. And because cloud networking VPC misconfigurations are one of the most common causes of security breaches, the stakes are high. Research from cloud security vendors consistently suggests that misconfiguration — not sophisticated attacks — accounts for the majority of cloud data exposures.

For an engineering manager, the practical implication is this: cloud networking is now a shared responsibility across your team, and you need enough fluency to enforce good patterns. You don't need to hand-roll routing tables, but you do need to recognize when a design will paint you into a corner.

Actionable takeaway: Treat network architecture as a first-class design artifact. Require a network diagram and a subnet plan before any greenfield project begins provisioning infrastructure.

Core Concepts and Architecture

Let's establish the vocabulary. These three components form the backbone of nearly every cloud deployment.

The VPC: Your Private Network in the Cloud

An AWS VPC (Virtual Private Cloud) is a logically isolated network that you define inside a cloud region. You assign it a CIDR block — for example, 10.0.0.0/16, which gives you 65,536 addresses to carve up. Within the VPC you create subnets, and each subnet lives in a single availability zone (AZ).

The critical distinction is between public and private subnets:

  • Public subnets have a route to an Internet Gateway. Resources here (like a load balancer or a bastion host) can be reached from the internet.
  • Private subnets have no direct inbound internet route. Your application servers and databases live here. They reach the internet for outbound calls (patches, API requests) through a NAT Gateway sitting in a public subnet.

Traffic control happens at two layers: security groups (stateful, attached to resources, allow-only rules) and network ACLs (stateless, attached to subnets, allow and deny rules). Most teams do 95% of their work with security groups and leave NACLs at defaults unless a specific compliance requirement demands otherwise.

Load Balancers: Distributing Traffic Reliably

A load balancer spreads incoming requests across multiple healthy instances, removing single points of failure and enabling horizontal scaling. On AWS, the Application Load Balancer (ALB) operates at Layer 7 (HTTP/HTTPS), understands paths and hostnames, and supports content-based routing — sending /api to one target group and /app to another. The Network Load Balancer (NLB) operates at Layer 4 (TCP/UDP), handles millions of requests per second with ultra-low latency, and is the right choice for non-HTTP protocols or extreme performance needs.

Load balancers run health checks against your targets and automatically stop routing to instances that fail. They also terminate TLS, offloading certificate management from your application.

CDNs: Serving Content Close to the User

A CDN like CloudFront caches your content at edge locations distributed globally. When a user in Frankfurt requests a static asset, they're served from a nearby edge node rather than your origin server in Virginia — cutting latency dramatically and reducing load on your origin. Modern CDNs cache not just images and JavaScript but also API responses (with careful cache-control headers) and can run lightweight compute at the edge via functions.

Finally, Route 53 — the DNS layer — ties everything together, resolving your domain to the correct CDN, load balancer, or endpoint, and supporting health-check-based failover and latency-based routing.

How They Fit Together

A typical request flow looks like this:

  1. User hits app.yourcompany.comRoute 53 resolves the DNS name.
  2. Static assets are served from CloudFront edge caches.
  3. Dynamic requests route to an ALB in the public subnets.
  4. The ALB forwards traffic to application servers in private subnets across multiple AZs.
  5. Those servers talk to a database in isolated private subnets, and reach external APIs via a NAT Gateway.

Actionable takeaway: Sketch this five-step flow for your own application. If you can't explain where each request goes, you have a knowledge gap worth closing before your next incident.

Implementation Strategy

Knowing the concepts is one thing; assembling them into a maintainable system is another. Here's a pragmatic sequence.

Start With a Deliberate Subnet Plan

Design your CIDR allocation before writing any infrastructure code. Reserve blocks generously — running out of IP space in a subnet is a genuinely painful problem to fix later. A common pattern for a three-AZ VPC:

  • Three public subnets (one per AZ) for load balancers and NAT gateways
  • Three private "application" subnets for compute
  • Three private "data" subnets for databases, fully isolated with no NAT route

Codify Everything

Never click your VPC together in the console for anything beyond a throwaway experiment. Use Terraform, AWS CloudFormation, or CDK so your network is versioned, reviewable, and reproducible across environments. This is where a partner like Halkwinds often adds value — we build infrastructure-as-code foundations that let teams stand up identical staging and production networks from the same modules, eliminating environment drift.

Choose the Right Load Balancer

RequirementRecommendedWhy
HTTP/HTTPS apps with path routingALBLayer 7 features, host/path rules, WebSocket support
Extreme throughput, low latencyNLBLayer 4, millions of req/sec, static IPs
Non-HTTP (TCP/UDP) protocolsNLBProtocol-agnostic at transport layer
Legacy single-app EC2 setupsClassic LB (avoid for new work)Deprecated feature set; migrate off it

Configure the CDN With Intent

Don't just put CloudFront in front of everything with default settings. Define cache behaviors per path pattern: aggressive, long TTLs for versioned static assets (app.a1b2c3.js), short or no caching for authenticated API calls, and correct handling of query strings and headers. Always enforce HTTPS and consider adding AWS WAF at the CloudFront layer for edge-level protection.

Actionable takeaway: Make your CIDR plan and load balancer choice explicit design decisions documented in your repo's README — not implicit choices buried in Terraform.

Scaling and Operational Considerations

Networks that work fine at launch often reveal weaknesses under growth. Plan for the following.

Multi-AZ Is Non-Negotiable

Spread every tier across at least two, ideally three, availability zones. An AZ failure should degrade capacity, not cause an outage. Load balancers only distribute across the AZs where they have subnets, so ensure your target groups span them all.

NAT Gateway Costs Add Up

NAT Gateways charge both hourly and per gigabyte processed. High-traffic private subnets pushing large volumes of outbound data — think container image pulls or S3 traffic — can generate surprising bills. Use VPC endpoints to route traffic to AWS services (S3, DynamoDB, ECR) privately, bypassing the NAT Gateway entirely and reducing both cost and latency.

Observability

Enable VPC Flow Logs to capture accepted and rejected traffic — invaluable for debugging connectivity issues and detecting anomalies. Monitor ALB metrics like HTTPCode_ELB_5XX_Count, TargetResponseTime, and UnHealthyHostCount. On CloudFront, watch cache hit ratio; a ratio below expectations usually means misconfigured cache keys or headers.

Failover and Global Reach

Use Route 53 health checks with failover routing to shift traffic to a secondary region if your primary becomes unhealthy. For latency-sensitive global audiences, latency-based or geolocation routing directs users to the nearest healthy region.

Actionable takeaway: Add VPC endpoints for S3 and ECR today if you use containers — it's a quick win that cuts NAT costs and often improves pull times.

Common Mistakes / What to Avoid

  • Putting databases in public subnets. Databases belong in isolated private subnets with no route to an internet gateway. Access them only from within the VPC or via a bastion/SSM.
  • Overly permissive security groups. The 0.0.0.0/0 on port 22 or 3306 is a recurring cause of breaches. Reference other security gro