Skip to main content

The hub-and- spoke network topology for developers

A common network topology used when building cloud infrastructures is the hub-and-spoke model. As I noticed that this model is not always well understood by developers, here is my attempt to describe this model from a developers viewpoint.

What Is a Hub-and-Spoke Network Topology?

A hub-and-spoke network topology is a type of network architecture where all devices are connected to a central hub. This central hub acts as a focal point for communication, and all the spokes (devices) communicate through this central hub. Think of it as the hub being the center of a wheel, with spokes radiating outward to various endpoints. This topology is also commonly referred to as a star topology.


As the name suggest, this topology has 2 key components:

  1. Hub: The central hub is a device that serves as the core of the network. It can be a physical device like a switch or a logical point in the network. The hub is responsible for managing and directing the flow of data between all connected devices. It's the heart of the network, ensuring efficient communication.

  2. Spokes: The spokes are the individual devices that connect to the hub. These devices can include computers, servers, routers, or any other network equipment. Each spoke communicates with the hub to exchange data with other spokes.

Hub-and-spoke on Azure

In the image above you can see an example on how to apply this in Azure. We centralize some services like our Azure Firewall, Azure Bastion and the VPN gateway in the Hub and peer with multiple Spoke vnets.

This model is most useful for larger cloud adoption efforts and offers the following advantages:

  • Saving on costs and efficient management: Centralize services that can be shared by multiple workloads, like network virtual appliances (NVAs) and DNS servers. With a single location for services, IT can minimize redundant resources and management effort.

  • Overcoming subscription limits: Large cloud-based workloads might require using more resources than a single Azure subscription contains. Peering workload virtual networks from different subscriptions to a central hub can overcome these limits.

  • Separation of concerns: You can deploy individual workloads between central IT teams and workload teams.

  • Security: All inbound and outbound traffic can be secured through the hub.

  • Scalability: It is easy to add new spokes without effecting the central hub.

Of course this model comes with its own set of drawbacks:
  • Single point of failure: If the hub goes down, all the spokes are disconnected.
  • Network latency: All traffic goes through the hub, more hops and longer distance.
  • Complex routing: All spokes need to be configured to route traffic through the hub.
  • Limited flexibility: All spokes are connected to the same hub, no direct connection between spokes.

As a developer we are typically using the available PaaS or SaaS components to compose our solutions. We can easily plug these into the hub-and-spoke model using any of the following methods:

  • Through VNET Integration for outbound traffic
  • Through Private Link for inbound traffic
  • Through Microsoft-managed virtual networks for many data services.
  • Out of the box through App Service Environments, Azure API Management and AKS

More information

Hub-and-spoke network topology - Cloud Adoption Framework | Microsoft Learn

Hub-spoke network topology in Azure - Azure Architecture Center | Microsoft Learn

Popular posts from this blog

Azure DevOps/ GitHub emoji

I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.

Podman– Command execution failed with exit code 125

After updating WSL on one of the developer machines, Podman failed to work. When we took a look through Podman Desktop, we noticed that Podman had stopped running and returned the following error message: Error: Command execution failed with exit code 125 Here are the steps we tried to fix the issue: We started by running podman info to get some extra details on what could be wrong: >podman info OS: windows/amd64 provider: wsl version: 5.3.1 Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:2655: connectex: No connection could be made because the target machine actively refused it. That makes sense as the podman VM was not running. Let’s check the VM: >podman machine list NAME         ...

Cleaner switch expressions with pattern matching in C#

Ever find yourself mapping multiple string values to the same result? Being a C# developer for a long time, I sometimes forget that the C# has evolved so I still dare to chain case labels or reach for a dictionary. Of course with pattern matching this is no longer necessary. With pattern matching, you can express things inline, declaratively, and with zero repetition. A small example I was working on a small script that should invoke different actions depending on the environment. As our developers were using different variations for the same environment e.g.  "tst" alongside "test" , "prd" alongside "prod" .  We asked to streamline this a long time ago, but as these things happen, we still see variations in the wild. This brought me to the following code that is a perfect example for pattern matching: The or keyword here is a logical pattern combinator , not a boolean operator. It matches if either of the specified pattern...