Saturday, 9 July 2022

Describing an Azure Service Fabric Service using ServiceManifest.xml

The ServiceManifest.xml declares information relevant to your microservice. 

Whether your service is stateless (no persistent storage, or state stored outside of the service, for example, through Azure Storage, Azure SQL Database, Azure Cosmos DB) or stateful, where Service Fabric manages your service state via Reliable Collections or Reliable Actors programming models.

Stateful applications are particularly interesting from an availability standpoint. The Reliable Collections API builds on System.Collections, and in particular, System.Collections.Concurrent, to create highly available (stateful) data structures while keeping code complexity to a minimum.

Reliable Collections ensure underlying data is replicated for high availability, operate asynchronously to ensure no blocking IO operations and transactional to ensure strong consistency (ensuring transaction commits finish only once changes are replicated on the majority quorum of replicas including the primary). They can also be persisted or volatile, the former where data is persisted to disk to protect against large scale outages.

Relevant data structures can be found in Microsoft.ServiceFabric.Data.Collections and in the assembly Microsoft.ServiceFabric.Data.Interfaces.dll.

No comments: