In Azure, high availability is achieved through a combination of features such as load balancing, auto-scaling, and redundancy.
Azure Load Balancer distributes traffic across multiple instances of a resource, ensuring no single point of failure. This is especially useful for web applications that require a high level of uptime.
Redundancy is also key in a high availability architecture, as it ensures that if one instance fails, another can take its place. Azure provides redundancy through features such as Availability Zones and paired regions.
By using these features together, you can create a highly available architecture in Azure that minimizes downtime and ensures your applications are always accessible.
Azure Networking
Azure Networking is a critical component of a high availability architecture. Every Azure VM is deployed into a virtual network that can be segmented into subnets, one subnet for each tier.
To restrict traffic between tiers, Network Security Groups (NSG) rules are used. Deny all inbound traffic from the virtual network, unless it's from the web-tier subnet or the database-tier subnet itself.
Here are the specific NSG rules to implement:
- Deny all inbound traffic from the virtual network. (Use the VIRTUAL_NETWORK tag in the rule.)
- Allow inbound traffic from the web-tier subnet.
- Allow inbound traffic from the database-tier subnet itself.
- These rules should have a higher priority than the first rule to overrid
Azure Load Balancer is also used to direct network traffic from the web tier to SQL Server. A zone-redundant Azure Standard Load Balancer provides availability in case the active SQL Server becomes unavailable, and supports cross-zone redundancy.
Networking and Load Balancing
Networking and Load Balancing is a crucial aspect of Azure architecture. Every Azure VM is deployed into a virtual network that can be segmented into subnets, one subnet for each tier.
In this architecture, a zone-redundant Azure Standard Load Balancer directs network traffic from the web tier to SQL Server. This provides availability in case the active SQL Server becomes unavailable.
Azure Load Balancer is a layer 4 load balancer, but for HTTP requests, you'll want to use a layer 7 load balancer like Azure Application Gateway. This routes HTTP requests to the web front end and provides a Web Application Firewall (WAF) that protects the application from common exploits and vulnerabilities.
Application Gateway supports cross-zone redundancy, and for production workloads, it's recommended to run at least two instances.
Here's a summary of the load balancing options:
Network Security Groups (NSGs) are used to restrict network traffic within the virtual network. You can use NSG rules to restrict traffic between tiers, such as only allowing the web tier to communicate directly with the database tier.
Zonal Services and Zone-Redundant Services
Azure Networking offers two types of services to ensure high availability and resilience: Zonal Services and Zone-Redundant Services.
Zonal services allow you to deploy resources to a specific availability zone, replicating applications and data to one or more zones within the region. This approach is self-architected and meets more rigorous latency or performance criteria.
Zone-redundant services automatically replicate resources across zones, ensuring high availability even in the event of a zone failure. For example, Azure Standard Load Balancer supports cross-zone redundancy, directing network traffic from the web tier to SQL Server while providing availability in case the active SQL Server becomes unavailable.
Zone-redundant services duplicate data over three zones, so a failure in one zone doesn't impair the data's high availability. This is in contrast to zonal services, which replicate data within a single zone.
Here are the key differences between Zonal Services and Zone-Redundant Services:
By using zone-redundant services, you can ensure that your applications and data are highly available and resilient to zone failures, providing a better user experience and minimizing downtime.
Direct Connection Benefits
Having a direct connection to Azure locations offers numerous benefits. You can establish a Layer 3 connectivity between your on-premises network and the Microsoft Cloud through a connectivity provider.
With a direct connection, you get connectivity to Microsoft cloud services across all regions within a geopolitical region. This ensures seamless communication between your network and Azure services.
If you opt for the ExpressRoute premium add-on, you can enjoy global connectivity to Microsoft Azure services across all regions. This is particularly useful for businesses with a global presence.
Dynamic routing between your network and Azure Microsoft via BGP is also a significant advantage. This allows for efficient and automatic routing of network traffic.
Built-in redundancy in every peering location ensures higher reliability and minimizes downtime. This is crucial for businesses that rely heavily on cloud services.
A connection uptime SLA is also provided, giving you peace of mind and ensuring that your connection is up and running as expected.
For businesses that rely on Skype for Business, QoS support is available to ensure a high-quality experience.
Azure Services
Azure Services play a crucial role in building a high availability architecture.
Azure provides a wide range of services that cater to various needs, including computing, storage, networking, and more.
Azure Compute services include Azure Virtual Machines, Azure Kubernetes Service, and Azure Functions, which enable scalable and on-demand computing.
Azure Storage services, such as Azure Blob Storage, Azure File Storage, and Azure Disk Storage, provide secure and durable storage options.
Azure Networking services, including Azure Load Balancer, Azure Application Gateway, and Azure Traffic Manager, ensure high availability and scalability for applications.
Azure Active Directory (Azure AD) provides identity and access management capabilities to secure applications and services.
Azure Monitor and Azure Log Analytics help you collect and analyze data to identify potential issues and improve overall system reliability.
Security
Security is a top priority in any architecture, and Azure provides robust features to protect your data and systems. Restricting incoming traffic to only come from Azure Front Door ensures that all traffic goes through the Web Application Firewall (WAF) before reaching your app.
This prevents malicious attacks and abuse of your valuable data and systems. For more information, see Overview of the security pillar.
Cross-Origin Resource Sharing (CORS) is a W3C standard that allows a server to relax the same-origin policy and allow some cross-origin requests while rejecting others. App Services has built-in support for CORS, so you don't need to write any application code.
SQL Database encryption is a must-have for sensitive data. Use Transparent Data Encryption to encrypt data at rest in the database, which performs real-time encryption and decryption of an entire database.
System managed identities are a game-changer for reducing credential management risks. Use them where possible, and ensure that every user managed identity exists in only one region and is never shared across region boundaries.
Service firewalls are crucial for controlling access to your services. Ensure that only region-local services have access to the services and that the services only allow outbound connections, which is explicitly required for replication and application functionality.
Azure Performance
Azure Performance is a crucial aspect of building a reliable and scalable architecture.
Azure App Service allows you to scale your application based on load.
This means you can automatically add more resources as your application's traffic increases, and remove them when it decreases, which helps prevent waste and saves you money.
A major benefit of this approach is performance efficiency, which enables your application to handle sudden spikes in traffic without downtime or slow performance.
This is especially useful for applications with unpredictable traffic patterns, such as those that are dependent on events or seasonal changes.
Azure Architecture
Azure Architecture is all about designing a robust and scalable system that can handle high traffic and maintain availability. This can be achieved through the use of Azure regions.
Azure regions serve multiple purposes, including geographic distribution, data residency and compliance, disaster recovery and business continuity, high availability and fault tolerance, service selection and feature availability, and scalability and load balancing.
Azure regions are formed from multiple datacentres, each with independent power, cooling, and networking. This provides a level of redundancy and fault tolerance that is hard to achieve with traditional on-premises datacentres.
SQL Server
Azure SQL DBaaS is a cost-effective option for SQL Server deployments. You can reduce costs by not needing to configure an Always On availability group and domain controller machines.
One of the benefits of Azure SQL DBaaS is the flexibility in deployment options, starting from a single database up to managed instances or elastic pools.
You're only charged for the number of configured load-balancing and outbound rules, with inbound NAT rules being free. This can lead to significant cost savings.
The Standard Load Balancer has no hourly charge when no rules are configured, making it a convenient option for smaller deployments.
Provisioning the Application Gateway with the v2 SKU allows you to span multiple Availability Zones, ensuring high availability and scalability.
The v2 SKU pricing model is driven by consumption, with two components: an hourly fixed price and a consumption-based cost.
Cosmos DB
Cosmos DB is a globally distributed, fully managed, low latency, multi-model, multi query-API database for managing data at large scale. It supports geo-replication across regions in an active-active pattern with multiple write regions.
You can designate one region as the writable region and the others as read-only replicas. This allows for a failover in case of a regional outage, where you can select another region to be the write region.
The client SDK automatically sends write requests to the current write region, so you don't need to update the client configuration after a failover.
Cosmos DB is used in conjunction with other Azure services, such as Azure Storage and Azure Front Door, to provide a scalable and highly available architecture.
Here are some key benefits of using Cosmos DB:
- Supports geo-replication across regions in an active-active pattern
- Can designate one region as the writable region and the others as read-only replicas
- Client SDK automatically sends write requests to the current write region
Service Bus
Service Bus is a crucial component of Azure Architecture, providing a robust messaging system for scalable and reliable communication between applications and services.
To ensure high resilience, use the premium tier for your namespaces, which utilizes availability zones to protect against data center outages.
Geo-disaster recovery is a key feature of the premium tier, allowing you to replicate your namespace configuration to a secondary location for rapid failover in the event of a disaster.
AI
Azure AI Search is a powerful tool that ensures high availability and business continuity through multiple replicas and search services. Having multiple replicas allows Azure AI Search to perform maintenance and machine reboots without disrupting query execution.
You can add replicas to your search service to utilize Availability Zones, placing each replica in a different Availability Zone within the region. This setup requires adding two or more replicas to your search service.
Multiple replicas enable Azure AI Search to do machine reboots and maintenance against one replica while query execution continues on other replicas. For more information on adding replicas, see Add or reduce replicas and partitions.
App Service Apps
Creating separate App Service apps for your web application and web API can be a good design choice. This allows you to run them in separate App Service plans, enabling independent scaling.
You're billed for VM instances in the plan, not per app, for Basic, Standard, Premium, and Isolated plans. This means you can scale your apps without incurring additional costs.
As a best practice, create a health probe path in your application origin that reports the overall health of the application. This health probe should check critical dependencies like App Service apps, storage queue, and SQL Database.
Don't use the health probe to check lower priority services, like email services, which can be switched to a second provider if needed.
Here are the benefits of deploying multiple App Service apps to separate plans:
- Independent scaling for each app
- No additional costs for scaling
By following these guidelines, you can create a scalable and efficient Azure architecture for your web application and web API.
Architecture
Azure Architecture is all about designing and building scalable, secure, and highly available systems. For a multi-region architecture, consider using Azure Front Door, which provides a global load balancing and content delivery network solution.
Azure Front Door can be used in a network-secured configuration, as mentioned in the Network secure ingress implementation documentation.
When designing a multi-region architecture, it's essential to consider the use of Availability Zones, which provide redundancy and isolation within an Azure region.
Availability Zones are physically separate zones within an Azure region, each with its own power source, network, and cooling infrastructure.
Here are some key benefits of using Availability Zones:
Azure Regions are also crucial in multi-region architectures, providing benefits such as geographic distribution, data residency and compliance, disaster recovery and business continuity, high availability and fault tolerance, service selection and feature availability, and scalability and load balancing.
Azure Regions are made up of multiple data centers, each with its own independent power, cooling, and networking infrastructure.
When designing a multi-region architecture, consider using Azure Front Door for load balancing and content delivery, and Availability Zones for redundancy and isolation.
Sample Questions
Azure Architecture requires a solid understanding of its core components. An Azure region is a key component, containing one or more data centers connected by a low-latency network.
Azure regions are designed to provide a high level of availability, but not every region has multiple Availability Zones. Some regions may have only one Availability Zone.
Availability Zones are used to enhance reliability and redundancy. You can run both Linux and Windows virtual machines in an Availability Zone.
Here's a quick rundown of the key points about Availability Zones:
Azure Regions
Azure regions are designed to provide both localized disaster protection with availability zones and regional or big geographic catastrophe protection with disaster recovery by utilizing another region. This is achieved by pairing regions within the same geography.
Each Azure region pairs with another region within the same geography, making a regional pair. For example, West US is paired with East US, and South-East Asia is paired with East Asia.
Azure regions are prewired with high bandwidth connectivity between them, allowing for geographically redundant solutions. This means that if a disaster recovery (DR) failover has to occur, you're still within inexpensive proximity to your secondary region.
Azure serializes platform updates so only one region is updated at a time, minimizing possible downtime. This is a benefit of using a paired region as your secondary region, such as East US 2 and Central US.
If your primary region doesn't have a pair, consider the following factors when selecting a secondary region: minimize latency by selecting regions that are geographically close to your users, and meet your data residency requirements by selecting regions that are in geographies you can store and process data in.
Here are some examples of region pairs:
- West US paired with East US
- South-East Asia paired with East Asia
- East US 2 paired with Central US
Azure regions in a pair have direct connections that bring additional benefits to using them together. Each Azure Region in a pair is always located greater than 300 miles apart when possible.
Azure Domains
Azure Fault Domains define the group of virtual machines that share a common power source and network switch. Each fault domain contains some racks, and each rack contains a virtual machine. These domains share a power supply and a network switch.
Azure Update domains and Fault Domains are two logical groupings of Azure resources designed to help distribute workloads across different physical hardware and software components, reducing the risk of downtime due to hardware or software failures or updates.
Here's a comparison of Update domains and Fault Domains:
Update Domain
Azure Update Domain is a logical grouping of resources that helps distribute workloads across different physical hardware and software components. This reduces the risk of downtime due to hardware or software failures or updates.
Virtual machines get assigned an update domain automatically when they're added to an availability set. This means they'll reboot together.
Update domains are used for patching of virtual machines, and only one update domain can be updated at a time.
Here are some key facts about update domains:
- Virtual machines get updated domains automatically once they are put inside the availability set.
- All virtual machines within that update domain will reboot together.
- They are used for patching of the virtual machines.
- Only one updated domain can be updated at a time.
What Is the Domain?
In Azure, a fault domain is a logical grouping of hardware that shares a common power source and network switch.
Each fault domain typically contains multiple racks, and each rack can host one or more virtual machines.
These fault domains are designed to be independent of each other, so that a failure in one domain won't affect the others.
However, if a failure occurs in a fault domain, all the resources within that domain will become unavailable.
To maximize availability and minimize downtime, it's essential to distribute your virtual machines across multiple fault domains.
Here are some best practices for placing your VMs in Azure:
- Place one web server in each fault domain.
- Place one database server in each fault domain.
- Consider placing other critical resources, such as load balancers or storage, in their own fault domains.
By following these guidelines, you can help ensure that your Azure infrastructure is highly available and resilient to failures.
Sources
- https://www.alifconsulting.com/post/iaas-web-application-database
- https://documentation.meraki.com/MX/Other_Topics/Deploying_Highly_Available_vMX_in_Azure
- https://learn.microsoft.com/en-us/azure/architecture/web-apps/app-service/architectures/multi-region
- https://k21academy.com/microsoft-azure/architect/azure-availability-zones-and-regions/
- https://k21academy.com/microsoft-azure/az-900-microsoft-azure-architecture-region-availability-zone-geography/
Featured Images: pexels.com