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

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         ...

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.

VS Code Planning mode

After the introduction of Plan mode in Visual Studio , it now also found its way into VS Code. Planning mode, or as I like to call it 'Hannibal mode', extends GitHub Copilot's Agent Mode capabilities to handle larger, multi-step coding tasks with a structured approach. Instead of jumping straight into code generation, Planning mode creates a detailed execution plan. If you want more details, have a look at my previous post . Putting plan mode into action VS Code takes a different approach compared to Visual Studio when using plan mode. Instead of a configuration setting that you can activate but have limited control over, planning is available as a separate chat mode/agent: I like this approach better than how Visual Studio does it as you have explicit control when plan mode is activated. Instead of immediately diving into execution, the plan agent creates a plan and asks some follow up questions: You can further edit the plan by clicking on ‘Open in Editor’: ...