37

Exploring Microservices in a Microsoft Landscape

Embed Size (px)

Citation preview

Page 1: Exploring Microservices in a Microsoft Landscape
Page 2: Exploring Microservices in a Microsoft Landscape

#TECHDAYSNLG106-107

Exploring micro-services in a Microsoft landscapeAlex Thissen Cloud architectXpirit

Page 3: Exploring Microservices in a Microsoft Landscape

© 2016 Microsoft Corporation. All rights reserved.

Page 4: Exploring Microservices in a Microsoft Landscape

About me: Alex [email protected]

@alexthissen

Xbox Live: LX360Xpirit

Page 5: Exploring Microservices in a Microsoft Landscape

AgendaIntroduction to micro-servicesDeveloping microservices in .NET

Frameworks and patternsHosting in Microsoft AzureSummarizing your options

Questions and AnswersDiscussion

Page 6: Exploring Microservices in a Microsoft Landscape

Introduction to micro-services

Page 7: Exploring Microservices in a Microsoft Landscape

Valued business drivers

Better• Resilient• Technology

choice

Cheaper• Test effort• Cost of

maintaining

Faster• Change• Deployment• Execution

Page 8: Exploring Microservices in a Microsoft Landscape

From monolith to pebblesCommon architectures or deployments

Autonomous small systems

Page 9: Exploring Microservices in a Microsoft Landscape

Benefits

Hetero-geneous

technology landscape

Resilience against failure

Selective scaling

Deployment of smaller pieces with lower risk

Alignment with

organization

Composability

Replaceability

Page 10: Exploring Microservices in a Microsoft Landscape

• Organized by logical cohesion• Teams own layers spanning domains• Unified technology choice

From horizontal to verticalChange your approach to vertical partitions

• Modeled after organization’s domains • Owned by team• Top to bottom• Isolated from each other as much as

possible

Page 11: Exploring Microservices in a Microsoft Landscape

User Interface Integration

Simplified microservices landscape

Partition 1

Service 3

Partition 2

Service 1

Service 2

UI

Autonomous business capabilities

Tighter coupling with appropriate

patterns for resiliency

Loose coupling by asynchronous event driven messaging

Following traditional SOA

tenets

Freedom of technology choice

High cohesion within partition

Asynchronous handling and calling

UI can be standalone or part of

microservice

Separate hosts for each partition and

service

Not all services are (public) web

services

Page 12: Exploring Microservices in a Microsoft Landscape

Obtain simplicity by adding complexity

Page 13: Exploring Microservices in a Microsoft Landscape

From vision to implementationImplementing microservices in Microsoft .NET

Page 14: Exploring Microservices in a Microsoft Landscape

Microservices landscape

Partition 1

Service 3

Partition 2

Service 1

Service 2

User Interface IntegrationUI

Page 15: Exploring Microservices in a Microsoft Landscape

Developing micro-servicesUsing Microsoft platform and technologies

Familiar tools and frameworks

ASP.NET MVC and Web APIWindows Communication Foundation

Service 1

Page 16: Exploring Microservices in a Microsoft Landscape

.NET Technology Stack

Host

Mac OSXLinux

Self Hosted

“Helios”IIS

IIS Native Module

IIS Native Module

CLR Core CLR Mono CLR

.NET FX 4.6.2

ASP.NET Core 1.0

Windows

CoreFX

ASP.NET 4.6

ASP.NET MVC Core 1.0ASP.NET MVC 5

Page 17: Exploring Microservices in a Microsoft Landscape

Intra-partition direct communication

Patterns you will need:1. Circuit breakerService 1

Service 2

2. Retry

• Standard RPC call to other service via client• Asynchronous outbound call

Page 18: Exploring Microservices in a Microsoft Landscape

Inter-partition communication

Events basedPersistent and durable

Service 1 Service 2

Queues Storage Schedulers Hubs Databases

Ideally platform agnostic medium from client and service regardless of platform or framework

Page 19: Exploring Microservices in a Microsoft Landscape

Balancing control and amount of work

ASP.NETWeb Services

Service Fabric Application

Function Apps

More control, more work Less control, more productivity

Page 20: Exploring Microservices in a Microsoft Landscape

Microservices in productionHosting Microservices in Microsoft Azure

Page 21: Exploring Microservices in a Microsoft Landscape

Hosting your services

Host

MicroServic

e

MicroServic

eMicroServic

e

MicroServic

e

Host

MicroServic

eHost

MicroServic

e

Host

MicroServic

eHost

MicroServic

e

High density hosting

One service per host

Host

Application container

MicroServic

e

MicroServic

e

Hosting in application container

Page 22: Exploring Microservices in a Microsoft Landscape

Where to host your micro-service?

Host OS

Virtual machines

PaaS

Container runtimes

Page 23: Exploring Microservices in a Microsoft Landscape

Containers with Docker and .NET

Page 24: Exploring Microservices in a Microsoft Landscape

From single machine to clusterHosting multiple services on many machines requires more

Lifecycle management• Availability guarantees• Fault tolerance• Rolling upgrades

Health monitoring• Portal• Event monitoring• Performance analysis

Resource governance• Combine single machines to

cluster• High density• Placement constraintsApplication management• Packaging and deployment• Granular versioning

Page 25: Exploring Microservices in a Microsoft Landscape

Microsoft Azure PlatformFor all your needs in Microservices

Page 27: Exploring Microservices in a Microsoft Landscape

Microsoft Azure Service FabricA platform for reliable, hyper-scale microservices

Azure

WindowsServer Linux

Hosted Clouds

WindowsServer Linux

Service Fabric

Private Clouds

WindowsServer Linux

High Availability

Hyper-Scale

Hybrid OperationsHigh Density

Rolling Upgrades Stateful

services

Low Latency Fast startup & shutdown

Container Orchestration & lifecycle management Replication &

FailoverSimple

programming models

Load balancing

Self-healingData Partitioning

Automated Rollback

Health Monitoring

Placement Constraints

Microservices

Page 28: Exploring Microservices in a Microsoft Landscape

Service Fabric for developersChacteristics• Stateful and stateless

services and actors• Reliable collections for

replicated state• Services built in full .NET

or .NET Core Framework• Host guest executables• Run anywhere including

local

Page 29: Exploring Microservices in a Microsoft Landscape

Azure Container ServiceContainer hosting solution for production workloads

Run images in a container cluster

Characteristics• Combines open

source tooling and frameworks

• Requires a Linux distribution compatible service implementation

Page 30: Exploring Microservices in a Microsoft Landscape

Typical ACS architecture/infrastructure (DC/OS)

Page 31: Exploring Microservices in a Microsoft Landscape

Facilitating inter-partition communication

Leverage PaaS services from Azure

Service 1 Service 2

Queues Storage Schedulers Hubs Databases

Ideally platform agnosticCross-platform SDK available

Page 32: Exploring Microservices in a Microsoft Landscape

Azure Function AppWrite C#/JavaScript function in cloudBuilt on Azure WebJobs SDK

Hosted in Azure Web App

Similar to Amazon LambdaKudu SCM portalTriggers

time, HTTP, EventHubIntegrate input and output

Page 33: Exploring Microservices in a Microsoft Landscape

Summary by comparisonAzure Offering Developme

nt Framework

Hosting Deployment Portal (Azure Portal)

Provisioning/Maintaining

Container Service

.NET Core 1.0

Any cloudOn-premises

Docker images

ZookeeperChronosMarathon

IaaS+

Service Fabric .NET 4.5+.NET Core 1.0

Any cloudOn-premises

SF application package

Fabric Portal PaaS

Web/API App .NET 4.5+.NET Core 1.0

Azure Azure Stack

MSDeploy App Insights PaaS

Function App C# Azure Source control

Kudu PaaS

Page 34: Exploring Microservices in a Microsoft Landscape

WrapupMicro-services are:A new architecture style for (web-)services with familiar elementsProvide business value at price of complexityBuilt with .NET Platform using tools and technologies you knowSeveral options in Azure to host micro-services applicationsTaking away some of the complexity

Page 35: Exploring Microservices in a Microsoft Landscape

http://www.xpirit.com

Leading IT specialists in Microsoft Application Lifecycle Management,

Cloud, Enterprise Mobility & Security style

Page 36: Exploring Microservices in a Microsoft Landscape

Traditional CRUD: • Mismatch between read and write representations• Contention of database

Solution: Segregate operations for reading and writing

Command and Query Responsibility Segregation

Page 37: Exploring Microservices in a Microsoft Landscape

CRUD approach:• Updates directly against

datastore• No recorded history

Solution: Handle operations on data by events which are recorded in append-only database

Event sourcing