skip to content

An estate has grown from three VPCs to about twenty-five, all connected with VPC peering. What breaks down at that scale, and what does moving to a Transit Gateway change — including on the bill?

level: seniorimportance: must knowfreq 62%

answer

  1. n(n−1)/2 versus one attachment each
  2. the pain is onboarding, not throughput
  3. the hub charges per hour and per GB
  4. peering is free of processing fees
  5. keep peering for the hottest pair

basics

~20 s

A peering mesh grows as n(n−1)/2 connections with a route-table entry per peer in every VPC, so each new VPC touches all the others. A Transit Gateway replaces that with one attachment and one route per VPC, routes transitively, and adds per-attachment-hour and per-GB processing charges peering does not have.

solid answer

~50 s

Peering does not scale operationally. Twenty-five VPCs fully meshed is 300 connections, every VPC's route tables carry an entry per peer against a per-table route quota, and onboarding VPC twenty-six means 25 new connections and 25 route-table changes across as many accounts. Nothing is broken — it is just unmanageable, and it is still non-transitive. A Transit Gateway turns the mesh into a hub: each VPC gets one attachment and a route to the gateway, the gateway's route tables decide who reaches whom, VPN and Direct Connect gateway attachments land on the same hub so on-premises reaches everything, and you share it across accounts with AWS Resource Access Manager. The tradeoff is real: peering has no hourly or per-GB processing charge, while a Transit Gateway bills per attachment-hour **and** per GB processed on top of normal data transfer, and it inserts a hop with a per-attachment bandwidth ceiling. Many estates keep peering for one or two very high-volume pairs and put everything else on the hub.

go deeper

for a junior

Know the shapes: peering connects two VPCs at a time, and a Transit Gateway is a hub every VPC attaches to once and which can route between them.

for a middle

Do the arithmetic and name the operational cost — n(n−1)/2 connections, a route-table entry per peer, and a new VPC touching every existing one — then contrast it with one attachment and one route on a hub.

for a senior

Bring the money and the migration: attachment-hour plus per-GB processing charges the hub adds, the case for keeping peering on a very high-volume pair, and an incremental cutover using more specific routes rather than a big bang.

for a principal

Own it as estate architecture — a network account owning a RAM-shared gateway, the segmentation the route tables encode, multi-Region strategy, and the blast radius you accept by making one hub load-bearing for every workload.

## What actually degrades Nothing about a peering connection gets slower as you add more of them. What degrades is the management surface. **Connection count.** A full mesh of *n* VPCs is *n(n−1)/2* connections. Three VPCs: three. Ten: forty-five. Twenty-five: three hundred. Each one was requested, accepted, tagged and is now something that shows up in an audit. **Route-table entries.** Every VPC's route tables need one entry per peer, in every route table associated with subnets that must reach that peer. Route tables have a quota on entries, and unlike a Transit Gateway you cannot summarize — you cannot point `10.0.0.0/8` at a single peering connection, because each connection only serves its own peer's address space. **Onboarding cost.** The killer. A new VPC is not one change; it is *n* connections and edits to *n* other VPCs' route tables, often across *n* AWS accounts with different owners and different change windows. **Still non-transitive.** All that work buys you no shared services path, no shared egress, and no single place for on-premises to land. ## What a Transit Gateway gives you A Transit Gateway is a regional routing hub. Attachment types include VPC, Site-to-Site VPN, Direct Connect gateway, peering to a Transit Gateway in another Region, and Connect attachments for SD-WAN appliances. Each VPC attaches once and carries one route — often a summary such as `10.0.0.0/8` — pointing at the gateway. The hub routes between attachments transitively, subject to its own route tables. On-premises connectivity arrives once, at the hub, rather than being rebuilt per VPC. And you share one gateway across the whole organization with AWS Resource Access Manager, so member accounts attach their VPCs to a gateway owned by a network account without owning the routing. Onboarding becomes O(1): one attachment, one route, one association. ## The bill, honestly This is where interview answers usually go thin. - **Peering:** no hourly charge for the connection, no per-GB processing fee. You pay only ordinary data-transfer charges, which for same-Region traffic depend on whether it crosses an Availability Zone boundary, and Region-crossing rates for inter-Region peering. - **Transit Gateway:** an hourly charge *per attachment* plus a *per-GB data-processing* charge for traffic through the gateway, on top of the same underlying data-transfer charges. Traffic between two VPCs on the hub is processed by the gateway — and, in the classic gotcha, traffic that traverses the hub in both directions can be charged on the way in and on the way out. The consequence: a chatty pair of VPCs moving tens of terabytes a month can cost meaningfully more on a hub than on a direct peering. Real estates therefore run a hybrid — the hub for general and hybrid connectivity, direct peering preserved for a small number of very-high-volume pairs. Saying that out loud is what marks the answer as operational rather than architectural-diagram-shaped. ## The other tradeoffs **A hop.** Traffic through the gateway takes an extra hop; the added latency is small but non-zero, and it matters for latency-critical east-west paths. **Per-attachment bandwidth.** A VPC attachment has a bandwidth ceiling; peering effectively rides the instances' own limits. For a single very high-throughput flow, direct peering is still the better pipe. **A shared failure and blast-radius domain.** The hub is now a component the whole estate depends on, and its route tables are a place where one mistake reaches everywhere. That is an argument for a dedicated network account, tight change control, and deliberate segmentation rather than one default route table. **Regional scope.** A Transit Gateway is regional. Multi-Region estates connect gateways with peering attachments between them, which is a design decision of its own. ## Migration shape You do not flip 300 connections in a night. The usual path: stand the gateway up in a network account, share it with RAM, attach VPCs one at a time, add the more specific Transit Gateway routes alongside the existing peering routes, validate, then remove peering routes and finally the peering connections. Because a more specific route wins over a less specific one in a VPC route table, you can move traffic pair by pair and keep a rollback. ## What interviewers listen for The combinatorics, the O(1) onboarding, the fact that the hub is where hybrid connectivity naturally lands — and then the cost caveat and the willingness to keep peering where it is genuinely cheaper. An answer that presents Transit Gateway as a strict upgrade has skipped the tradeoff the question is about.

  • Is there any case for keeping VPC peering once a Transit Gateway exists?
    Yes — a pair of VPCs exchanging very high volume. Peering has no attachment-hour or per-GB processing charge, adds no hop, and is not subject to the gateway's per-attachment bandwidth ceiling. Many estates run the hub for general and hybrid connectivity while preserving direct peering for one or two hot pairs.
  • How do you migrate from a peering mesh to a Transit Gateway without a big-bang cutover?
    Attach VPCs incrementally and lean on longest-prefix matching. Add more specific routes toward the Transit Gateway alongside the existing peering routes so one pair at a time shifts, validate with flow logs or Reachability Analyzer, then withdraw the peering routes and finally delete the connections.
  • How does a Transit Gateway get used by VPCs owned by other AWS accounts?
    The owning account — normally a dedicated network account — shares the gateway through AWS Resource Access Manager. Member accounts then create attachments for their own VPCs, but the gateway's route tables stay under the network account's control, which is what keeps routing policy central while VPC ownership stays federated.

saying these in an interview costs you the question

  • A Transit Gateway is always cheaper than peering
  • The hub is free; you only pay for data transfer
  • Peering scales fine, you just add more connections
  • One Transit Gateway covers every Region automatically
  • Attaching a VPC to the hub makes it reachable regardless of route tables

context