Azure Service Fabric
Azure Service Fabric is Microsoft’s platform-as-a-service (PaaS) and is used to build and deploy microservices-based cloud applications. However, before we can understand Azure Service Fabric, it’s important that we understand the evolution from monolithic apps to microservices-based apps.
Background - Monolithic Apps vs Microservices
Prior to microservices, most applications were built with the app’s functionalities tightly coupled into one service. This monolithic approach has a number of disadvantages, including long downtimes when new features are being deployed, scaling is slow and expensive, and availability and reliability are achieved through hardware redundancy, which is both complex and expensive. These disadvantages are of increasing importance when it comes to the current cloud era, where time-to-market and ability to scale are more important than ever.
- A monolithic app is normally divided into functional layers, such as web, business and data.
- A monolithic app is scaled by cloning it on, for example, multiple virtual machines (VMs).
- With a microservice application, you separate functionality into smaller, modular services.
- A microservices app scales out by creating instances of these services across VMs or containers.
In contrast to the monolithic app approach, microservices-based apps are split into sets of small, loosely coupled services. Each one is independently versioned and scalable, and the services communicate with each other over standard protocols and well-defined interfaces. Using the microservices approach to app building means that each service can be updated and scaled independently of each other. This in turn improves agility and efficiency. The majority of Internet-scale services are made up of microservices, including protocol gateways, user profiles, shopping carts, inventory processing, queues, and caches. However, these microservices need code for inter-service communications; for example, to deal with errors and failures and to report metrics. This is where Azure Service Fabric comes in.
So What Actually Is It?
Azure Service Fabric is an open source project and is used in Azure infrastructure as well as other Microsoft services, including Azure Event Hubs, Azure Cosmos DB, Azure SQL DB, Dynamic 365 and Cortana. The major sub-sections of Service Fabric can be seen below:
Service Fabric is a platform that makes it easier to build and deploy microservices-based applications, handling both stateful and stateless operations. It will run on any Windows system and there’s also a Linux version, which means that it’s portable across multiple cloud environments including Amazon Web Services, OpenStack and VMware.
Apps that are created in the Azure Service Fabric environment are made up of granular microservices, small chunks of code which are uploaded and run separately. These microservices communicate with each other using service application-programming interfaces (APIs). Because microservices are modular, it’s possible to scale each component of an app separately which simplifies the process of rolling out changes, in contrast to traditional monolithic architecture.
Service Fabric provides lifecycle management capabilities to microservice based applications. The microservices are hosted inside containers that are deployed across the Service Fabric cluster. Using containers instead of virtual machines means a massive increase in density and greater still density can be achieved by moving from containers to microservices in these containers. For instance, a single cluster for Azure SQL Database is made up of hundreds of machines running tens of thousands of containers that in turn host hundreds of thousands of databases. Each database is a Service Fabric stateful microservice.
You can create clusters for Service Fabric on site, on Azure, on public clouds, on Windows Server or on Linux. The development environment in the software development kit (SDK) is exactly the same as the production environment. There are no emulators involved so what runs on your local development cluster can be deployed to the clusters in other environments.
For development being carried out on Windows, the Service Fabric .NET SDK is integrated with Visual Studio and Powershell. For Linux, the Service Fabric Java SDK is integrated with Eclipse.
The key capabilities of Service Fabric include being able to:
- develop scalable applications that are made up of microservices, which can be stateless or stateful.
- write code once and then deploy it to any Service Fabric cluster.
- deploy applications quickly and at a high density.
- upgrade applications independently.
- monitor the health of your application and set policies for automatic repairs.
- manage the life cycle of your applications without any downtime.
- 24th November, 2018: Version 1