
Implementing Azure Fabric Architecture requires careful planning to ensure cloud success. This involves understanding the architecture's core components, including the Fabric Controller, which manages the distribution of workloads across the fabric.
A well-designed fabric architecture is essential for achieving high availability and scalability in the cloud. This can be achieved by implementing a load balancer to distribute incoming traffic across multiple instances.
To ensure efficient resource utilization, it's recommended to use a combination of virtual machines and containers in the fabric. This allows for greater flexibility and scalability, as seen in the example of using Azure Virtual Machines and Azure Container Instances.
By following these best practices, organizations can create a robust and scalable cloud infrastructure that meets their evolving needs.
Design and Planning
Designing and planning your Azure Service Fabric architecture is crucial for its success. A microservice is a small, independently versioned unit of code that's discoverable through service discovery mechanisms and can communicate with other services over APIs.
To build, deploy, and upgrade microservices efficiently, Service Fabric provides an infrastructure that also offers options for autoscaling, managing state, monitoring health, and restarting services in case of failure. Each service is self-contained and should implement a single business capability.
For production scenarios, use Standard SKU for cluster architecture, and durability level Silver (5 VMs) or greater for Standard clusters. You can also consider using Availability Zones for critical workloads.
Here are some key design principles to keep in mind:
- Use Standard SKU for production scenarios.
- Use durability level Silver (5 VMs) or greater for Standard clusters.
- Consider using Availability Zones for critical workloads.
- Create additional, secondary node types for your workloads.
Design Considerations
Design Considerations are crucial when building a microservices architecture. A microservice is a small, independently versioned unit of code.
Each service should implement a single business capability. Service Fabric provides an infrastructure to build, deploy, and upgrade microservices efficiently.
Service Fabric follows an application model where an application is a collection of microservices. The application is described in an application manifest file.
This file defines the types of services that the application contains, along with pointers to the independent service packages. The application package also usually contains parameters that serve as overrides for certain settings that the services use.
Services and applications are independently versioned and upgradable. Avoid using default services if you want to control the lifetime of your services.
Design Checklist
When designing your Azure Service Fabric architecture, it's essential to consider the following key principles.
Use the Standard SKU for production scenarios to ensure reliability. This will help you avoid potential issues that can arise from lower-tier options.
For critical workloads, consider using Availability Zones for your Service Fabric clusters. This will provide an additional layer of redundancy and ensure that your application remains available even in the event of a zone failure.
For production scenarios, use the Standard tier load balancer. This will provide a more robust and reliable solution compared to lower-tier options.
Create additional, secondary node types for your workloads. This will help ensure that your application remains available even in the event of a node failure.
Here are the key design principles to keep in mind:
- Use Standard SKU for production scenarios.
- Consider using Availability Zones for critical workloads.
- Use Standard tier load balancer for production scenarios.
- Create additional, secondary node types.
By following these design principles, you can help ensure the reliability and availability of your Azure Service Fabric architecture.
Service Fabric Configuration
Service Fabric Configuration is a crucial aspect of Azure Fabric Architecture. It's essential to understand how to configure your Service Fabric cluster for scalability.
You should create a node type for each group of services that have different scalability or resource requirements. This means provisioning a node type for the Service Fabric system services, separate node types for public or front-end services, and additional node types for back end and private or isolated services.
Specify placement constraints so that the services are deployed only to the intended node types. This ensures that your services are running on the right nodes with the right resources.
The durability tier represents the ability of Service Fabric to influence updates and maintenance operations in virtual machine scale sets. For production workloads, choose a Silver or higher durability tier.
If you're using the Bronze durability tier, certain operations require manual steps. Node types with the Bronze durability tier require additional steps during scale-in.
Here's a summary of the node types to create:
- Primary node type for Service Fabric system services
- Node types for public or front-end services
- Node types for back end and private or isolated services
Scalability and Performance
Service Fabric supports scaling cluster entities, including scaling the number of nodes for each node type and scaling services. You can choose to manually scale in situations where it's appropriate.
To achieve scalability, provision node types based on security and scalability needs, and specify durability tiers for each node type. The Bronze durability tier requires additional steps during scale-in, while the Silver and Gold tiers support automatic scale-in.
To scale services, use the average partition load trigger for stateless services, or set InstanceCount to -1 in the service manifest to enable dynamic scaling. For stateful services, scaling is controlled by the number of partitions, the size of each partition, and the number of partitions or replicas running on a machine.
To optimize performance, exclude Service Fabric processes from Windows Defender, use Autoscaling for your cluster, and consider using Accelerated Networking. You can also leverage loosely-coupled microservices, event-driven architecture, and background processing for your workloads.
Here are some performance recommendations for Azure Service Fabric:
Scalability
Scalability is a critical aspect of Service Fabric, and it's essential to understand how it works. You can scale Service Fabric clusters in various ways, including scaling the number of nodes for each node type and scaling services.
Service Fabric supports autoscaling, which allows you to automatically scale your cluster based on demand. However, manual intervention might be required in certain situations, such as setting the number of instances.
To create a Service Fabric cluster that's scalable, you need to provision node types based on your security and scalability needs. Each node type should be mapped to a virtual machine scale set and can be scaled independently.
Here are some key considerations for initial cluster configuration:
- Create a node type for each group of services that have different scalability or resource requirements.
- Specify the durability tier for each node type, which represents the ability of Service Fabric to influence updates and maintenance operations in virtual machine scale sets.
- If you're using the Bronze durability tier, certain operations require manual steps, such as additional steps during scale-in.
Service Fabric also supports autoscaling for scale-in and scale-out, and you can configure each node type for autoscaling independently. However, each node type can have a maximum of 100 nodes.
To support automatic scale-in, you need to configure the node type to have the Silver or Gold durability tier. This configuration ensures that scaling in is delayed until Service Fabric finishes relocating services.
Stateless and stateful services apply different approaches to scaling. For stateless services, you can use the average partition load trigger to determine when the service is scaled in or out based on a load threshold value.
Here are some key differences between scaling stateless and stateful services:
Scaling services can be done in various ways, including using autoscale rules or manually scaling. You can also scale a Service Fabric cluster programmatically or by adding a virtual machine scale set.
In terms of performance efficiency, Service Fabric has several recommendations, including excluding Service Fabric processes from Windows Defender to improve performance and considering using Autoscaling for your cluster. Accelerated Networking can also improve performance by reducing latency, jitter, and CPU utilization for the most demanding network workloads.
When designing your Service Fabric solution, it's essential to consider the different ways you can scale your solution, including using scaling to enable maximum resource utilization. You can also use metrics to balance load and report custom metrics using the IServicePartition.ReportLoad method.
Balancing Load with Metrics
To avoid uneven distribution of workload across nodes, partition the service state so that it's distributed across all partitions. This can be achieved by using the range partitioning scheme with a good hash algorithm.
Service Fabric uses metrics to know how to place and balance services within a cluster. You can specify a default load for each metric associated with a service when that service is created.
The initially specified default load for a service will not change over the lifetime of the service. To capture changing metrics for a service, it's recommended to monitor your service and then report the load dynamically.
Use the IServicePartition.ReportLoad method to report custom metrics. This allows Service Fabric to adjust the allocation based on the reported load at a given time.
Here are some key metrics to consider when balancing load:
By monitoring and reporting these metrics, you can ensure that your services are properly balanced and that your cluster is running efficiently.
Availability and Reliability
Availability and reliability are crucial components of Azure Service Fabric architecture. To ensure availability, place your services in a node type other than the primary node type, as system services are always deployed to the primary node type.
This helps avoid resource competition and interference with system services. Consider constraining resources for your services, and specify placement constraints to prevent resource-governed services from running on the same nodes as non-governed services.
To avoid a single point of failure, ensure every service's target instance or replica count is greater than one. The largest number that can be used as a service instance or replica count equals the number of nodes that constrain the service.
For stateful services, have at least two active secondary replicas, and we recommend five replicas for production workloads. This ensures high availability and reliability.
The reliability subsystem provides a mechanism to make state highly available through the Replicator, Failover Manager, and Resource Balancer. The Replicator ensures state changes are replicated to secondary replicas, maintaining consistency between primary and secondary replicas.
The Failover Manager redistributes load across available nodes when nodes are added or removed, and reconfigures service replicas to maintain availability if a node fails. The Resource Manager balances service resources across nodes for optimal load distribution.
To implement resiliency patterns, consider using the Retry, Circuit Breaker, and Bulkhead patterns. The Retry pattern handles transient errors, while the Circuit Breaker pattern addresses faults that take longer to fix. The Bulkhead pattern isolates resources for each service.
Here are some common considerations for resource governance:
- Don't mix resource-governed and non-governed services on the same node type.
- Specify placement constraints to prevent resource-governed services from running on the same nodes as non-governed services.
- Specify the CPU cores and memory to reserve for a service instance.
Frequently Asked Questions
What is Fabric in Azure?
Service Fabric is an open source project that powers core Azure infrastructure and several Microsoft services, including Skype for Business and Dynamics 365. It's a scalable and reliable platform for building cloud-based applications and services.
What are the 5 pillars of architecture in Azure?
The 5 pillars of architecture in Azure are reliability, cost optimization, operational excellence, performance efficiency, and security. These pillars provide a foundation for building a well-designed and scalable cloud solution.
Sources
- https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/microservices/service-fabric
- https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-architecture
- https://learn.microsoft.com/en-us/azure/well-architected/service-guides/azure-service-fabric-well-architected-framework
- https://www.infoworld.com/article/2338884/understanding-onelake-and-lakehouses-in-microsoft-fabric.html
- https://www.jamesserra.com/archive/2024/08/microsoft-fabric-reference-architecture/
Featured Images: pexels.com