44
Service Fabric Result of an experiment Stéphane Erbrech @serbrech

From a monolith to microservices with Azure Service Fabric

Embed Size (px)

Citation preview

Service FabricResult of an experiment

Stéphane Erbrech

@serbrech

Stéphane ErbrechWebstep

02/12/2016 2

Twitter : @serbrechhttp://www.erbrech.com/blog

Origins of this experimentMicroservicesDevOpsConcepts : Service DiscoveryConcepts : Reverse ProxyDemosChallengesConclusion

02/12/2016 3

Workers CompensationContact

02/12/2016 4

Bang Head Here

02/12/2016 5

Think locally, Act Globally

02/12/2016 6

The road to Microservices

02/12/2016 7

02/12/2016 8

1 year of “Microservices”

Which module does this functionality fit?Add codeMergeGet a coffee

02/12/2016 9

1 year of “Microservices”How/where do we host this service? Where?Cloud? Which product? How to deploy? Monitor? communicate with The Monolith?Business case validation?Configuration management? (that one is a biggy)On premise? IIS Setup?Authentication/Authorization?Logging?What DB can/should we use? SqlServer, Ravendb, DocumentDB?Versioning?Test environments?CI setup?Deployment scripts? Internet facing services?What about security?Etc, …

02/12/2016 10

New services nearly every release, every week

150 git repos

1 person can’t assess the entire system

1 year of “Microservices”

02/12/2016 11

1 year of “Microservices”

# Windows services

# IIS processes

02/12/2016 12

1 year of “Microservices”

40 Windows services (doubled)

52 IIS processes (doubled)

X2 (x4)

02/12/2016 13

Local Simplicity vs

Architecture/Infrastructure Complexity

02/12/2016 14

Scalability

Highly Available24/7

Zero Down Time DeploysCloud

Serverless

DevOps

Blue Green

02/12/2016 15

Essentially 1 server

02/12/2016 16

02/12/2016 17

Concepts

Service Discovery

Decouple the who from the where

02/12/2016 18

Service A Service B

config

Communicate

02/12/2016 19

Service Discovery

Service A Service B

Config

Communicate

02/12/2016 20

Service DiscoveryService Discovery

Service Discovery

Service A Service BCommunicate

Highly available, Consistent

02/12/2016 21

Service DiscoveryService Discovery

Service Discovery

Service A Service BCommunicate

Highly available, Consistent

Service AService A

Service BService B

02/12/2016 22

02/12/2016 23

A

B

B

A

SD

A

B

A

SD

A

SD

Reverse Proxy

02/12/2016 24

???

02/12/2016 25

A

B

B

A

SD

A

B

A

SD

A

SD

Service DiscoveryService DiscoveryService Discovery

Service A Service BService A

Service AService B

Service B

R

Reverse proxy

02/12/2016 26

R

02/12/2016 27

A

B

B

A

SD

A

B

A

SD

A

SD

Service Fabric

02/12/2016 28

02/12/2016 29

Cluster management for microservices

Windows or Linux

Process deployment and orchestration

02/12/2016 30

Stateless / Stateful services

Partitions

Health monitoring

Actors

Containers

Web Apps

02/12/2016 31

WCF

02/12/2016 32

Windows Services

02/12/2016 33

Minimize (negative) impact, Maximize benefits

02/12/2016 34

Can we do this?

What would this mean for developers?

What would it mean for DevOps?

What does it mean for the Lifecycle?

What do we get from this?

So, can we have the cake, and eat it too?

02/12/2016 35

Challenges

MSMQ : bound to a machineDistributed Transactions

02/12/2016 36

queue

Server1

NSB

queue

Server2

NSBSubscribe(msg@server1)

Publish(queue@server2

Send(queue@Server2)

02/12/2016 37

queue

Server1

NSB

queue

Server2

NSB

Broker

02/12/2016 38

queue

Server1

NSB

queue

Server2

NSB

Broker

02/12/2016 39

DTC

DTC (and other 2PC protocols) require HA and low latency between resources.

Incompatible with the cloud

02/12/2016 40

Outbox and Deduplication Pattern

“Using Outbox allows for running endpoints with similar reliability to DTC while not actually using DTC.”

At least once + deduplication

DTC : Msmq/NServiceBus

02/12/2016 41

https://docs.particular.net/nservicebus/outbox/

02/12/2016 42

DTC : WCF

No tricks there unfortunately

Move data

Replace with messaging

02/12/2016 43

Wrap up

Service Fabric ticks all the boxesCloud vs On-premNot invasiveFuture proof (cloud, container, no vendor lock-in)

Remove DTC and MSMQ

02/12/2016 44

Thank youMicroservices article

http://www.erbrech.com/blog/2016/10/27/What-we-dont-tell-you-about-microservices.html

Hosting a web app In Service Fabric

http://www.erbrech.com/blog/2016/11/01/Hosting-a-web-application-in-Service-Fabric.html

Service Fabric Overview

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-overview

Twitter : @serbrechhttp://www.erbrech.com/blog