Transcript
Page 1: Azure Service Fabric Overview

Azure Service FabricPREVIEW OverviewJoão Pedro Martins26.Mar.2016

Page 2: Azure Service Fabric Overview

João Pedro “jota” MartinsSoftware ArchitectMicrosoft Azure Insider + AdvisorCo-founder - GASP + APPUTechEd 2006 – “Iron Architect” WinnerBizTalk Server MVP 2006-2011

Page 3: Azure Service Fabric Overview

Ground Rules and ExpectationsThis is based on a non-RTM SDK:

there will be problems

This is a different way of architecting software: there will be many disagreements

There is a lot to say: there won’t be enough time

Page 4: Azure Service Fabric Overview

What’s this session about?Microsoft Azure Service Fabric= A platform for reliable, hyperscale, microservice-based applications= PaaS v2 + Stateful Services/Actors= Platform for applications BORN FOR THE CLOUD, not Lift&Shift’ed

Page 5: Azure Service Fabric Overview

the platform

Page 6: Azure Service Fabric Overview

Microsoft Azure Service FabricA platform for reliable, hyperscale, microservice-based applications

Microservices

CommunicationManagement Reliability HostingSubsystem

Testability

Federation

Transport

Application Programming Models

Azure

WindowsServer Linux

Hosted Clouds

WindowsServer Linux

Service Fabric

Private Clouds

WindowsServer Linux

High Availability

Hyper-Scale

Hybrid Operations

High 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

Page 7: Azure Service Fabric Overview

Battle-hardened for over 5 yearsAzure Core

Infrastructure

thousands of machines

Power BI

Intune

800k devices

Azure SQL Database

1.4 million databases

Bing Cortana

500m evals/sec

Azure Document

DB

billions transactions/wee

k

Skype for Business

Hybrid Ops

Event Hubs

20bn events/day

… and the Halo 4 multiplayer as “Project Orleans”

Page 8: Azure Service Fabric Overview

Service Fabric CapabilitiesApplication deployment services:

Rolling update with rollback Strong versioning Side-by-side support

Leadership electionName service for discovery of applications

High densityPartitioning supportLoad balancing and placement constraintsConsistent state replication frameworkReliable distributed key/value store, collections and queues

Page 9: Azure Service Fabric Overview

Service Fabric MicroservicesA microservice is whatever you want it to be:– ASP.NET, node.js, Java VMs, an arbitrary .exe

Stateless microservices– A microservice that has state where the state is persisted to

external storage, such as Azure databases or Azure storageStateful microservices– Reliability of state through replication and local persistence– Reduces the complexity and number of components in

traditional three-tier architecture

Page 10: Azure Service Fabric Overview

Service Fabric vs. Cloud ServicesCloud Services Service Fabricevolution

Page 11: Azure Service Fabric Overview

A set of machines that Service Fabric stitches together to form a cluster

Clusters can scale to1000s of machines

Cluster: A federation of machines

Node

Node

Node

Node

Node

Node

Page 12: Azure Service Fabric Overview

Cluster: System viewSystem Services Failover manager

Cluster manager

Naming

Image store

Page 13: Azure Service Fabric Overview

ReconfigurationTypes of reconfiguration

– Primary failover– Removing a failed

secondary – Adding recovered replica– Building a new secondary P

S

S

S

S

S

Must be safe in the presence of cascading failures

B PXFailed

XFailed

Page 14: Azure Service Fabric Overview

Upgrading Services with zero downtime

Application Package FD0/UD0

FD0/UD1

FD1/UD6

FD1/UD5

FD2/UD4

FD2/UD3

FD – Failure Domain; UD – Upgrade Domain

Page 15: Azure Service Fabric Overview

Basics for devsDownload from WebPI

Sets up local dev cluster with 5 nodes by default

Includes service fabric explorer + powershell cmdlets

Same code that runs on Azure

Page 16: Azure Service Fabric Overview

Stateless service + Automatic Failoverdemo

Page 17: Azure Service Fabric Overview

the programming model

Page 18: Azure Service Fabric Overview

What is a microservice?Is (logic + state) that is independently versioned, deployed, and scaledHas a unique name that can be resolved (e.g. fabric:/myapplication/myservice)Interacts with other microservices over well defined interfaces and protocols like RESTRemains always logically consistent in the presence of failuresHosted inside a “container” node (code + config)Can be written in any language/framework (node.js, Java VMs, any EXE)Developed by a small engineering team

Page 19: Azure Service Fabric Overview

Types of microservicesStateless microservice– Has either no state or it can be retrieved from an external store – There can be N instances– e.g. web frontends, protocol gateways, Azure Cloud Services etc.

Stateful microservice–Maintain hard, authoritative state– N consistent copies achieved through replication and local

persistence– e.g. database, documents, workflow, user profile, shopping cart, IoT

devices, multiplayer games, etc.

Page 20: Azure Service Fabric Overview

Queues Storage

3-Tier service patternFront End(StatelessWeb)

StatelessMiddle-tierCompute

Cache

• Scale with partitioned storage

• Increase reliability with queues

• Reduce read latency with caches

• Manage your own transactions for state consistency

• Many moving parts each managed differently

Load Balancer

Page 21: Azure Service Fabric Overview

StatefulMiddle-tierCompute

Stateful services: Simplify design, reduce latency

Front End(StatelessWeb)

data stores used for analytics and disaster recovery

• Application state lives in the compute tier

• Low Latency reads and writes

• Partitions are first class for scale-out

• Built in transactions

• Fewer moving parts

Load Balancer

Page 22: Azure Service Fabric Overview

Stateful microservice

Application Package

PSSreplication replication

PSS

Page 23: Azure Service Fabric Overview

Service Fabric Programming Models

Reliable Actors APIReliable Services API

Azure Private Clouds

Applications composed of microservices

High Availability

Hyper-Scale

Hybrid Operations

High 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

Service Fabric

Page 24: Azure Service Fabric Overview

Reliable Services APIBuild stateless services using existing technologies such as ASP.NETBuild stateful services using reliable collections• ReliableDictionary<T>, ReliableQueue<T>• Data Contract SerializerManage the concurrency and granularity of state changes using transactionsCommunicate with services using the technology of your choice • e.g. WebAPI , WCF Collections

• Single machine• Single threaded

Concurrent Collections• Single machine• Multi threaded

Reliable Collections• Multi machine• Multi threaded• Replicated (HA)• Persistence• Asynchronous• Transactional

Page 25: Azure Service Fabric Overview

Stateful service + Automatic Failoverdemo

Page 26: Azure Service Fabric Overview

Service Fabric Programming Models

Reliable Actors APIReliable Services API

Azure Private Clouds

Applications composed of microservices

High Availability

Hyper-Scale

Hybrid Operations

High 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

Service Fabric

Page 27: Azure Service Fabric Overview

Reliable Actors APIBuild reliable stateless and stateful objects with a virtual actor programming model• Finally, we have Object-Oriented MicroservicesSuitable for applications with multiple independent units of state and computeAutomatic activation managementAutomatic state management and turn based concurrency (single threaded execution)

Page 28: Azure Service Fabric Overview

Rolling upgrades with no downtime (+ actors)

demo

Page 29: Azure Service Fabric Overview

ShipGateway

BoltAsteroid

Fire!

Turn

You are launchedGet state

• Ships• Asteroids• Bolts• Scores

• Velocity• Health• Position• Name

• Velocity• Decay• Position

• Velocity• Position• IsEvil?

Get state

Join a session

ActoroidsArchitectural example

commands

Accelerate/brake

Get state

Get state

You hit something

You are destroyed

You are destroyed

Get state

move

moveevil? chase(): move()

makes all kinds of decisions

Page 30: Azure Service Fabric Overview

Azure Compute Continuum

Ultimate Control

Rapid Development

VMs /VM Scale Sets VM Extensions Service Fabric /

BatchWeb Apps/ App Service

IaaS PaaS

Page 31: Azure Service Fabric Overview

Service Fabric RoadmapAzure Service

GA H1 2016Windows Server 2012 R2/Windows Server 2016 TP1

Public preview Feb 2016 GA June 2016 for WS2012 R2

and WS2016 RTM (Includes integration with Windows containers)

Azure Stack Targeting H2 2016

Linux (Includes integration with

Docker containers) Private preview April 2016 Public preview H2 2016 GA H2 2016

Page 32: Azure Service Fabric Overview

ReferencesService Fabric• http://aka.ms/ServiceFabric Service Fabric Documentation• http://aka.ms/ServiceFabricdocsService Fabric Samples• https://azure.microsoft.com/en-us/documentation/samples/?service=service-fabric • https://github.com/Azure-Samples/service-fabric-dotnet-getting-startedAkka.net (the other .Net implementation of the Actor Model)• http://getakka.net/Actor Model (1973)• https://en.wikipedia.org/wiki/Actor_modelMartin Fowler on Microservices• http://martinfowler.com/articles/microservices.html

Page 33: Azure Service Fabric Overview

João Pedro “jota” [email protected](+351) 96 782 5537 [email protected]/in/joaopedromartins/

THANK YOU! QUESTIONS?