don’t call me microservice just, because i’m in · • microservice is about architecture...
TRANSCRIPT
Don’t call me
Microservice just,
because I’m in
docker container.
X = Horizontal scale
Y = Functional Scale
Z = Data Partitioning
Scale Cube
X – ScaleHorizontal, Load Balancing, More Nodes,..
ServiceService
Service
DBClient
Client
Client ServiceService
Service
NLB
Z – Scale = Data PartitioningTenants, …
ServiceService
Service DB
Client
Client
Client ServiceService
ServiceDB
Y – Scale = µicro ServiceFunctional Scale
ServiceServiceµ
Service - 1DB1
Client
Client
ClientServiceµ
Service - 2
DB2
Service Fabric is cluster, which provides
scale in all 3 dimensions.
What can run in SF-cluster?
Service Fabric Application Model
Service Fabric Application Model
Cluster of Microservices
https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-resource-manager-balancing
https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-resource-manager-metrics
Deployment
• Copy Application Package• Connect-ServiceFabricCluster ClusterPublicIP:19000
• Register Application Type• Copy-ServiceFabricApplicationPackage
-ApplicationPackagePath 'C:\AppPath’-ImageStoreConnectionString 'file:C:\SfDevCluster\Data\ImageStoreShare' -ApplicationPackagePathInImageStore 'nodeapp‘
• Create Application• New/Update-ServiceFabricApplication -ApplicationName 'fabric:/nodeapp'
-ApplicationTypeName 'NodeAppType' -ApplicationTypeVersion 1.0
• Create Service• New/Update-ServiceFabricService -ApplicationName 'fabric:/nodeapp' -ServiceName
'fabric:/nodeapp/nodeappservice' -ServiceTypeName 'NodeApp' -Stateless -PartitionSchemeSingleton –InstanceCount 1
DEMO
Console Application as a Service
https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-deploy-existing-app
Stateless Services
Client
Client
ClientN
LB
Stateless Services are
X-scale of Scale Cube.
This is traditional NLB
approach.
<StatelessService InstanceCount=3>
<SingletonPartition />
</StatelessService>
DEMO
Stateless Service
https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-quick-start
Service State
Code+Config
Data
URL
Reliable Dictionary
Synchronized across:
1 – Active Primary Node
2 – Passive Secondary Nodes
Statefull Services
Client
Client
ClientN
LB
Statefull Services are
Z-scale of Scale Cube.
This is known as
Partitioning approach.Singleton Partition
<StatefulService ServiceTypeName=“ABC"TargetReplicaSetSize=“2"MinReplicaSetSize=“3">
<UniformInt64PartitionPartitionCount=“1"LowKey="1“ HighKey="5" />
</StatefulService>
DEMO
Statefull Service3 Replicas + 3 Partitions
Fault Domains
Mapping UD to FD
Upgrade Domains
Placement Properties
How to set placement properties?
New-ServiceFabricService -ApplicationName $applicationName -ServiceName $serviceName –
ServiceTypeName $serviceType -Stateful -MinReplicaSetSize 2 -TargetReplicaSetSize 3
-PartitionSchemeSingleton
-PlacementConstraint "HasSSD == true && SomeProperty >= 4"
StatefulServiceUpdateDescription updateDescription = newStatefulServiceUpdateDescription();updateDescription.PlacementConstraints = "HasSSD == true && SomeProperty >= 4 ";fabricClient.ServiceManager.UpdateServiceAsync(new Uri("fabric:/app/service"), updateDescription);
Cluster Balancing
https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-resource-manager-balancing
Recap
• Microservice is about architecture design of application.
• Service is service. There is nothing bad about it.
• Microservice is (Y) functional scale and not deployment in container.
• Service Fabric can scale in 3 dimensions
• Service Fabric provides Upgrade- and Fault-Domains.
• It supports different partition types for statefull services.
• Singleton partition is used for stateless services.
• We can deploy anything to SF cluster
• SF works On-Prem and in Cloud.
• Actor Model is specific implementation of reliable collection.
• Company with SF skills in Germany is daenet
References
• Where to Start?• DocMap: https://azure.microsoft.com/en-us/documentation/learning-paths/service-fabric/
• Docs: https://docs.microsoft.com/en-us/azure/service-fabric/
• TeamBlog: https://blogs.msdn.microsoft.com/azureservicefabric/
• Partitions• https://blogs.msdn.microsoft.com/mvpawardprogram/2015/10/13/understanding-service-fabric-partitions/
• http://developers.de/blogs/damir_dobric/archive/2016/06/03/working-with-partitions-in-service-fabric.aspx
• https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-concepts-partitioning