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