Service Fabric
Yves Goeleven
From Applications to MicroServices
What a difference 10 years makes
Deploy
10 years agoContinuous Integration Always-on, hyper-scale servicesService FabricContinuous Deployment
Yves Goeleven
Solution Architect
• MessageHandler.net
• Particular Software (NServiceBus)
• Windows Azure MVP
Automates Microservice Lifecycle Management
What is Service Fabric?
Service Fabric
It automates following aspects of the lifecycle:
• Zero-downtime deployment
• Rolling upgrade & side by side versioning
• Health monitoring & diagnostics
• Auto-scaling & resource balancing
• Data partitioning & replication
• Host integration (Windows Update coordination)
• Test In Production (Chaos service)
• Cross-datacenter clustering (optional)
It’s not new! It’s production proven technology.
What is Service Fabric?
Designed to host azure’s services:
• Azure Database
• Azure DocumentDB
• Power BI
• Azure Compute & Network provisioning (ARM)
• Event Hub
• Service Bus (ARM & Azure Pack)
• Azure Data Factory
• Intune
• Cortana
• Bing Weather
• Skype for Business
• Microsoft Online Directory Services
Microsoft Azure
Node Node Node Node Node
Nodes, Application Types & Service Types
What is a Service ?
Service represents:
• executable unit of code
• it’s configuration
• and data
Application
Service Service Service
Code Config Data Code Config Data Code Config Data
in any shape or form, including:
• Any x64 exe
• Container (Docker and friends)
• Dnx ( aspnet 5 )
• Actor models (Orleans, SF, Akka.net)
• Grouped into Application Types
• Managed by nodes
With resource balancing
Clustered into logical ring
Node
Node
Node
Node
Node
Developer Machine
An abstraction over virtual machines
Nodes
Azure Cluster Production DataCenterProduction: 1 Node == 1 VM
Nodes are weaved into orthogonal Update & Fault Domains
Why is it called a Fabric ?
Azure, own datacenter, windows, linux, amazon, …
Multiple hosting options
AZURE VMWARE HYPER-V
Availability
Replica
Management
Health ALM
Load
Balancing
Diagnostics Partitioning Placement
Service Fabric
Yves Goeleven
Demo Application Model
Runtime API Layers
Programming models
Actor Framework API
Service Framework API
Collection/KVS API
State Management API
Replication Set
Management API
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
Provided By
Windows Fabric
Provided By User
Application
Replica set
Management
State
Replication
State
Storage
Messaging Programming
Model
Business
Logic
Games, IoT scenarios
Traditional Enterprise Applications
Custom communication
Replicated Data Structure Providers
Replicator Providers
High Level Comparison
Choosing between Actors & Services
Reliable Actors API Reliable Services API
Simplicity Flexibility
Small independent units of state & logic Logic across multiple components
Single threaded objects Use reliable collections to store & manage state
Framework manages concurrency & state You manage concurrency & state
Platform manages communication You want to manage communication
Partitioning scheme managed for you You can manage the partitioning scheme
Service Fabric
Yves Goeleven
Demo Actors
Statefull Stateless
Actor Model
Client
Reliable State
Manager
Transactional
Replicator
Local Persistent
Log
Shared Log
Dedicated
Log
To secondaries
Proxy
Ac1
Ac2
Ac3
Ac4
Ac5
Proxy
Proxy
Proxy
Proxy
Proxy
Client
Proxy
Ac1
Ac2
Ac3
Ac4
Ac5
Proxy
Proxy
Proxy
Proxy
Proxy
Reliable
Dictionary State
Provider
Actor Activation
State
State
State
State
State
Communication
Listener
Actor Activation
Communication
Listener
Concurrency
Actor Model
Time
ActorId1
Method1
ActorId1
Method2
ActorId1
Timer
ActorId2
Method1
ActorId2
Method2
ActorId2
Reminder
Request arrived, lock
acquired without wait
Entered method1
Created task
Exited method1
Task completed
Lock released
Lock acquired
Entered method2
Created task
Exited method2
Task completed
Lock released
Request arrived,
waiting for lock
asynchronously
Request arrived,
waiting for lock
asynchronously
Lock acquired
Entered callback
Created task
Exited callback
Task completed
Lock released
Lock acquired
Entered callback
Created task
Exited callback
Task completed
Lock released
Lock acquired
Entered method1
Created task
Exited method1
Task completed
Lock released
Request arrived, lock
acquired without wait
Entered method2
Created task
Exited method2
Task completed
Lock released
Request arrived,
waiting for lock
asynchronously
Request arrived,
waiting for lock
asynchronously
Service Fabric
Yves Goeleven
Demo Services
Statefull Stateless
Service Model
Client
Communication
Listener
Service Impl
StatefullService
StatefullServiceBase
Client
Communication
Listener
Service Impl
StatelessService
StatelessServiceBase
Other
Communication
Channels
Client
Other
Communication
Channels
Client
Reliable State
Manager
Transactional
Replicator
Local Persistent
Log
Shared Log
Dedicated
Log
To secondaries
Proxy Proxy
Service Fabric
Yves Goeleven
Demo ASP.Net
Single machine Cluster
Mind the load balancer
Machine
Client
Http
Http.sys
Node
Node
Node
Node
Node
Service Client
Http
Node
Node
Node
Node
Node
Http.sys
Http.sys
Http.sys
Http.sys
Http.sys
N
L
B
Service
Service
Service
Service
Service
*Probing may skew the results a bit
@YvesGoeleven
yves@goeleven.com
github.com/yvesgoeleven/ServiceFabric.IoTSample
Service Fabric
Yves Goeleven
VISUG Partners

Service Fabric Overview (Yves Goeleven)

  • 1.
  • 2.
    From Applications toMicroServices What a difference 10 years makes Deploy 10 years agoContinuous Integration Always-on, hyper-scale servicesService FabricContinuous Deployment
  • 3.
    Yves Goeleven Solution Architect •MessageHandler.net • Particular Software (NServiceBus) • Windows Azure MVP
  • 4.
    Automates Microservice LifecycleManagement What is Service Fabric? Service Fabric It automates following aspects of the lifecycle: • Zero-downtime deployment • Rolling upgrade & side by side versioning • Health monitoring & diagnostics • Auto-scaling & resource balancing • Data partitioning & replication • Host integration (Windows Update coordination) • Test In Production (Chaos service) • Cross-datacenter clustering (optional)
  • 5.
    It’s not new!It’s production proven technology. What is Service Fabric? Designed to host azure’s services: • Azure Database • Azure DocumentDB • Power BI • Azure Compute & Network provisioning (ARM) • Event Hub • Service Bus (ARM & Azure Pack) • Azure Data Factory • Intune • Cortana • Bing Weather • Skype for Business • Microsoft Online Directory Services Microsoft Azure
  • 6.
    Node Node NodeNode Node Nodes, Application Types & Service Types What is a Service ? Service represents: • executable unit of code • it’s configuration • and data Application Service Service Service Code Config Data Code Config Data Code Config Data in any shape or form, including: • Any x64 exe • Container (Docker and friends) • Dnx ( aspnet 5 ) • Actor models (Orleans, SF, Akka.net) • Grouped into Application Types • Managed by nodes
  • 7.
    With resource balancing Clusteredinto logical ring Node Node Node Node Node
  • 8.
    Developer Machine An abstractionover virtual machines Nodes Azure Cluster Production DataCenterProduction: 1 Node == 1 VM
  • 9.
    Nodes are weavedinto orthogonal Update & Fault Domains Why is it called a Fabric ?
  • 10.
    Azure, own datacenter,windows, linux, amazon, … Multiple hosting options AZURE VMWARE HYPER-V Availability Replica Management Health ALM Load Balancing Diagnostics Partitioning Placement
  • 11.
  • 12.
    Runtime API Layers Programmingmodels Actor Framework API Service Framework API Collection/KVS API State Management API Replication Set Management API [ ] [ ] [ ] [ ] [ ] [ ] Provided By Windows Fabric Provided By User Application Replica set Management State Replication State Storage Messaging Programming Model Business Logic Games, IoT scenarios Traditional Enterprise Applications Custom communication Replicated Data Structure Providers Replicator Providers
  • 13.
    High Level Comparison Choosingbetween Actors & Services Reliable Actors API Reliable Services API Simplicity Flexibility Small independent units of state & logic Logic across multiple components Single threaded objects Use reliable collections to store & manage state Framework manages concurrency & state You manage concurrency & state Platform manages communication You want to manage communication Partitioning scheme managed for you You can manage the partitioning scheme
  • 14.
  • 15.
    Statefull Stateless Actor Model Client ReliableState Manager Transactional Replicator Local Persistent Log Shared Log Dedicated Log To secondaries Proxy Ac1 Ac2 Ac3 Ac4 Ac5 Proxy Proxy Proxy Proxy Proxy Client Proxy Ac1 Ac2 Ac3 Ac4 Ac5 Proxy Proxy Proxy Proxy Proxy Reliable Dictionary State Provider Actor Activation State State State State State Communication Listener Actor Activation Communication Listener
  • 16.
    Concurrency Actor Model Time ActorId1 Method1 ActorId1 Method2 ActorId1 Timer ActorId2 Method1 ActorId2 Method2 ActorId2 Reminder Request arrived,lock acquired without wait Entered method1 Created task Exited method1 Task completed Lock released Lock acquired Entered method2 Created task Exited method2 Task completed Lock released Request arrived, waiting for lock asynchronously Request arrived, waiting for lock asynchronously Lock acquired Entered callback Created task Exited callback Task completed Lock released Lock acquired Entered callback Created task Exited callback Task completed Lock released Lock acquired Entered method1 Created task Exited method1 Task completed Lock released Request arrived, lock acquired without wait Entered method2 Created task Exited method2 Task completed Lock released Request arrived, waiting for lock asynchronously Request arrived, waiting for lock asynchronously
  • 17.
  • 18.
    Statefull Stateless Service Model Client Communication Listener ServiceImpl StatefullService StatefullServiceBase Client Communication Listener Service Impl StatelessService StatelessServiceBase Other Communication Channels Client Other Communication Channels Client Reliable State Manager Transactional Replicator Local Persistent Log Shared Log Dedicated Log To secondaries Proxy Proxy
  • 19.
  • 20.
    Single machine Cluster Mindthe load balancer Machine Client Http Http.sys Node Node Node Node Node Service Client Http Node Node Node Node Node Http.sys Http.sys Http.sys Http.sys Http.sys N L B Service Service Service Service Service *Probing may skew the results a bit
  • 21.
  • 22.