don’t call me microservice just, because i’m in · • microservice is about architecture...

27

Upload: others

Post on 20-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice
Page 2: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Don’t call me

Microservice just,

because I’m in

docker container.

Page 3: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

X = Horizontal scale

Y = Functional Scale

Z = Data Partitioning

Scale Cube

Page 4: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

X – ScaleHorizontal, Load Balancing, More Nodes,..

ServiceService

Service

DBClient

Client

Client ServiceService

Service

NLB

Page 5: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Z – Scale = Data PartitioningTenants, …

ServiceService

Service DB

Client

Client

Client ServiceService

ServiceDB

Page 6: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Y – Scale = µicro ServiceFunctional Scale

ServiceServiceµ

Service - 1DB1

Client

Client

ClientServiceµ

Service - 2

DB2

Page 7: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Service Fabric is cluster, which provides

scale in all 3 dimensions.

Page 8: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

What can run in SF-cluster?

Page 9: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Service Fabric Application Model

Page 10: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Service Fabric Application Model

Page 11: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

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

Page 12: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

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

Page 13: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

DEMO

Console Application as a Service

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-deploy-existing-app

Page 14: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Stateless Services

Client

Client

ClientN

LB

Stateless Services are

X-scale of Scale Cube.

This is traditional NLB

approach.

<StatelessService InstanceCount=3>

<SingletonPartition />

</StatelessService>

Page 15: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

DEMO

Stateless Service

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-quick-start

Page 16: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Service State

Code+Config

Data

URL

Reliable Dictionary

Synchronized across:

1 – Active Primary Node

2 – Passive Secondary Nodes

Page 17: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

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>

Page 18: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

DEMO

Statefull Service3 Replicas + 3 Partitions

Page 19: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Fault Domains

Page 20: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Mapping UD to FD

Page 21: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Upgrade Domains

Page 22: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Placement Properties

Page 23: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

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);

Page 24: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

Cluster Balancing

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-resource-manager-balancing

Page 25: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

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

Page 26: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice

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

Page 27: Don’t call me Microservice just, because I’m in · • Microservice is about architecture design of application. • Service is service. There is nothing bad about it. • Microservice