Service Fabric enables you to build and operate always-on, hyper-scale services using the same technology powering Microsoft’s Cloud. This learning path will help you get started developing scalable, reliable, and easily-managed applications for the cloud.

What is Service Fabric?

The service fabric is a distributed platform available both on azure and on premise. The platform is used to run the application components in Windows Server 2016. The technology enables to run on multiple nodes to jointly deliver a service in a highly available and scalable manner as part of a Service Fabric cluster. No shared storage is required, instead all the nodes replicate state synchronously between nodes which ensures all nodes have an up-to-date copy of the state of the service the cluster offers. Where persistent state is required an external storage, service is used such as Azure Storage or Azure SQL Database.

Service Fabric offers Stateless and Stateful modes for APIs and ASP.Net Core architectures. It is designed to run todays new breed of microservices that are quickly created and deleted as required. A microservice approach breaks a service into small parts that can be distributed and scaled independently. The term actors are used, which are instances of microservices.

Applications composed of microservices

Service Fabric enables you to build and manage scalable and reliable applications composed of microservices that run at high density on a shared pool of machines, which is referred to as a cluster. It provides a sophisticated, lightweight runtime to build distributed, scalable, stateless, and stateful microservices running in containers. It also provides comprehensive application management capabilities to provision, deploy, monitor, upgrade/patch, and delete deployed applications including containerized services.

In the current trends Service Fabric powers many Microsoft services today, including Azure SQL Database, Azure Cosmos DB, Cortana, Microsoft Power BI, Microsoft Intune, Azure Event Hubs, Azure IoT Hub, Dynamics 365, Skype for Business, and many core Azure services.

Service Fabric is tailored to create cloud native services that can start small, as needed, and grow to massive scale with hundreds or thousands of machines.

Service Fabric is a microservices platform?

Today’s Internet-scale services are built of microservices. Examples of microservices include protocol gateways, user profiles, shopping carts, inventory processing, queues, and caches. Service Fabric is a microservices platform that gives every microservice (or container) a unique name that can be either stateless or stateful.

Service Fabric provides comprehensive runtime and lifecycle management capabilities to applications that are composed of these microservices. It hosts microservices inside containers that are deployed and activated across the Service Fabric cluster. A move from virtual machines to containers makes possible an order-of-magnitude increase in density. Similarly, another order of magnitude in density becomes possible when you move from containers to microservices in these containers. For example, a single cluster for Azure SQL Database comprises hundreds of machines running tens of thousands of containers that host a total of hundreds of thousands of databases. Each database is a Service Fabric stateful microservice.

Azure Service Fabric (ASF) Platform

Service Fabric Platform is the next generation platform-as-a-service offering from Microsoft Azure. It is also termed as PaaS 2.0 that not only supports stateless services but also stateful services to build highly performant, reliable, and scalable enterprise applications. The current Microsoft PaaS 1.0 mainly provides a worker and Web role as stateless services that can’t maintain their own state. On the other hand, stateful microservices (user info, product info, shopping carts, and so forth) maintain a mutable state beyond their request and response. Microsoft claims that this is the same technology that powers their Cloud infrastructure, and many other services such as Skype for business, Even Hubs, DocumentDB, and Azure SQL Databases (maintaining more than million databases).

So, Azure Service Fabric is the framework to rapidly break down a complex business problem into reliable and scalable stateless or stateful microservices. The resulting architecture would look like that in below Figure, where the front end services are load balanced to handle the request from end users while many stateful microservices do the actual work behind the scenes. Because data can be reliably persisted in the service, we don’t have to fetch or save data from an external store for every request.

Application design with Service Fabric

Azure Service Fabric (PaaS 2.0) Advantages

The major difference between Azure PaaS 1.0 and PaaS 2.0 is the introduction of stateful services in the later version. Now, with Azure Service Fabric, we can create stateful services that can hold data