⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All Networking & Cloud DNS Interview Questions Scenario 51 of 55 in Networking & Cloud DNS
Senior Cloud Engineer (L2) Networking Cloud Architecture & Routing L2 Cloud Screen
🎯 Target Role / Context: Senior Cloud Engineer L2 Interview

Q: When would you choose AWS Transit Gateway versus VPC Peering, and why?

Deep architectural comparison between AWS VPC Peering and AWS Transit Gateway, covering routing complexity, bandwidth, pricing, and scaling limits.

#Networking #AWS #Transit Gateway #VPC Peering #Architecture #Cost Optimization
🎙️ Candidate Opening & Architectural Context
"The choice between AWS VPC Peering and AWS Transit Gateway comes down to scale, operational complexity, transitive routing needs, and cost. VPC Peering is a point-to-point, non-transitive connection with zero hourly cost and highest performance. Transit Gateway is a centralized cloud router that simplifies complex multi-VPC and hybrid-cloud topologies at the cost of hourly attachment fees and data processing charges."
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? KodeKloud's Istio Service Mesh & Advanced Kubernetes Networking Course covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: The choice between AWS VPC Peering and AWS Transit Gateway comes down to scale, operational complexity, transitive routing needs, and cost. VPC Peering is a point-to-point, non-transitive connection with zero hourly cost and highest performance. Transit Gateway is a centralized cloud router that simplifies complex multi-VPC and hybrid-cloud topologies at the cost of hourly attachment fees and data processing charges.

1

Architecture & Transitive Routing Comparison

VPC Peering does NOT support transitive routing (VPC A cannot talk to VPC C through VPC B). For N VPCs to communicate fully via peering, you require N*(N-1)/2 peering connections (e.g. 50 VPCs require 1,225 peering links), creating an unmanageable routing table mesh. Transit Gateway acts as a central hub (hub-and-spoke), supporting transitive routing across hundreds of VPCs, VPNs, and Direct Connect links.

VPC A→Transit Gateway Central Hub→VPC B / On-Prem Direct Connect / Inspection VPC
2

Performance & Bandwidth Comparison

VPC Peering has no bandwidth limits or single-point-of-failure choke points; traffic flows over the AWS global backbone at line rate with zero added latency. Transit Gateway has a limit of 50 Gbps per VPC attachment burst (expandable via ECMP) and introduces a negligible sub-millisecond hop.

Pro Tip: Performance Rule: For massive data transfer pipelines between two high-throughput VPCs, VPC Peering provides higher throughput and zero data processing fees.
Advertisement
3

Cost Model Breakdown

Cost structures are fundamentally different: - VPC Peering: $0.00 base cost per hour. Standard inter-AZ data transfer fees apply ($0.01/GB). Same-AZ peering is completely FREE. - Transit Gateway: $0.05/hour per attachment ($36.50/month per VPC) + $0.02 per GB data processing fee ON TOP of standard data transfer fees.

# Cost Example: 20 VPCs transferring 50 TB/month
# VPC Peering: ~$500 in data transfer
# Transit Gateway: (20 * $36.50) + (50,000 GB * $0.02) + data transfer = ~$2,230/month
4

Centralized Network Security & Inspection

Transit Gateway allows routing all east-west and north-south traffic through a centralized 'Security/Inspection VPC' containing AWS Network Firewall or Palo Alto appliances before forwarding to destinations. VPC Peering cannot achieve this without complex proxying.

💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Choose VPC Peering for small, high-throughput VPC topologies (under 5-10 VPCs) where lowest cost and highest bandwidth matter. Choose Transit Gateway for large enterprise multi-account environments (10+ VPCs), hybrid on-premises connectivity, and centralized firewall inspection."
⚡ 60-Second Elevator Pitch Talking Points
  • Use VPC Peering for 1-to-1 high-bandwidth connections with zero hourly cost and line-rate performance.
  • Use Transit Gateway for hub-and-spoke architectures connecting 10+ VPCs, VPNs, and Direct Connect.
  • Transit Gateway enables transitive routing and centralized firewall traffic inspection.
  • Consider cost: Transit Gateway charges $0.05/hr per attachment plus $0.02/GB data processing fees.
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Treating stateless Network ACLs as stateful firewalls without specifying outbound ephemeral return ports when configuring Transit Gateway Peering Security Groups track connection state automatically, whereas stateless Network ACLs require explicit ephemeral port rules (1024-65535) for return traffic.
  2. Opening short-lived non-pooled TCP client connections, exhausting ephemeral ports in TIME_WAIT state when configuring Transit Gateway Peering Rapidly opening and closing short-lived TCP sockets without connection pooling exhausts ephemeral ports, causing connection refusal errors.
  3. Directing load balancer health checks to heavy computational endpoints rather than dedicated health routes when configuring Transit Gateway Peering Deep health check paths amplify database load during traffic spikes and risk cascading eviction of healthy application nodes.
  4. Triggering BGP route dampening by rapidly announcing and withdrawing multihomed network prefixes when configuring Transit Gateway Peering Rapidly flapping BGP route announcements triggers upstream ISP route dampening, effectively blackholing network traffic for hours.
Advertisement
Want more Networking & Cloud DNS scenarios?
Explore our complete collection of scenario-based Networking & Cloud DNS interview runbooks.
Browse All Networking & Cloud DNS Questions →