Service Fabric – building tomorrows applications today
-
Upload
biztalk360 -
Category
Technology
-
view
1.582 -
download
2
Transcript of Service Fabric – building tomorrows applications today
![Page 1: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/1.jpg)
Sponsored & Brought to you by
Service Fabric – building tomorrow’s applications todayMick Badran
http://www.twitter.com/mickba
https://au.linkedin.com/in/mickbadran
![Page 2: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/2.jpg)
PEOPLE TECHNOLOGY INTEGRATION
Service Fabric – Building Tomorrows Applications TodayMick BadranIntegration Monday 2015-11-23
PRESENTATION
![Page 4: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/4.jpg)
Solutions - How to Connect?
![Page 5: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/5.jpg)
• What is Service Fabric• Demo – Stateful Actor counters• Service Fabric Applications• Demo – Stateful with Events• Service Fabric Clusters• Demo – Stateful Services – causing chaos• Upgrading Apps with no downtime• Demo – No Downtime Upgrade• Wrap Up…
Agenda
![Page 6: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/6.jpg)
What is Service Fabric?
![Page 7: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/7.jpg)
Application development in the age of the CloudFeatures
Scalability
Manage ServicesDeliver Features FasterCreate Business Value
AvailabilityLatencyLifecycleData IntegrityPortability
![Page 8: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/8.jpg)
MICROSOFT AZURE SERVICE FABRICA PLATFORM FOR RELIABLE, HYPERSCALE, MICROSERVICE-BASED APPLICATIONS
Microservices
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 9: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/9.jpg)
BATTLE-HARDENED FOR OVER 5 YEARS
Azure 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
![Page 10: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/10.jpg)
What is a microservice?Is (logic + state) that is independently versioned, deployed, and scaled
Has a unique name that can be resolvede.g. fabric:/myapplication/myservice
Call other Microservices
Remains always logically consistent in the presence of failures
Hosted inside a “container” (code + config)
![Page 11: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/11.jpg)
Stateless applications A service that has state where the state is persisted to external storage, such as Azure
databases or Azure storage e.g. Existing web (ASP.NET) and worker role applications
Stateful applications Reliability of state through replication and local persistence Reduces latency Reduces the complexity and number of components in traditional three tier architecture
Existing apps written with other frameworks node.js, Java VMs, any EXE
What can you build with Service Fabric
![Page 12: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/12.jpg)
Installing Service FabricProvision through the Azure PortalProvision via an Install – Win10/Win2012/R2
http://aka.ms/ServiceFabric
![Page 13: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/13.jpg)
Service Fabric Applications
Azure Private Clouds
Applications composed of microservices
High Availability
Hyper-Scale
Hybrid OperationsHigh
DensityRolling 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
Reliable Actors API Reliable Services API
![Page 14: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/14.jpg)
Reliable Actor API• Build reliable stateless and stateful objects with a virtual Actor
Programming Model
• Suitable for applications with multiple independent units of state and compute
• Automatic state management and turn based concurrency (single threaded execution)
![Page 15: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/15.jpg)
Demo: Stateful Counters
![Page 16: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/16.jpg)
Application Package
Unit of • Lifetime• Versioning• Isolation
Counter Service type
Counter WebApp type
Defining applications and services
CounterService
Pkg
Code Config
CounterWebApp
Pkg
Application Type
![Page 17: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/17.jpg)
Instantiating an application
• ServiceType is “like” a .NET CLR type (class CounterServiceType)• ApplicationType is “like” a typed Container (CounterAppType : ServiceContainer<TServiceType> where TServiceType is
CounterServiceType, ServiceType2• ApplicationInstance is an instance of the ApplicationType and has an unique name “fabric:/CounterApplication”• Each service instance has a unique name in the “namespace” of the application
“fabric:/CounterApplication/CounterService”
Service Package
B
Service Package
A
app1
Service Package
B
Service Package
A
app4
Service Package
B
Service Package
A
app2
Service Package
B
Service Package
A
app3
![Page 18: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/18.jpg)
Reliable Collections• Reliable collections make it easy to build stateful services.
• Evolution of the .NET collections for the cloud
Collections• Single machine• Single threaded
Concurrent Collections• Single machine• Multi threaded
Reliable Collections• Multi machine• Replicated (HA)• Persistence (durable)• Asynchronous• Transactional
![Page 19: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/19.jpg)
Reliable Services API• Build stateless services using existing technologies such as ASP.NET
• Build stateful services using reliable collections
• Manage the concurrency and granularity of state changes using transactions
• Communicate with services using the technology of your choice (e.g WebAPI, WCF)
![Page 20: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/20.jpg)
Cloud Services
Azure Tables/NoSQL
Reliable Azure Queue
Service Fabric(Stateful)
Typical Service Fabric ServiceCloud Service vs Stateful Service Fabric
![Page 21: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/21.jpg)
Demo: Reliable Actor API with Events
![Page 22: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/22.jpg)
Service Fabric Clusters
![Page 23: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/23.jpg)
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 24: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/24.jpg)
SERVICE FABRIC SUBSYSTEMS
Communicationsubsystem
Reliabilitysubsystem
Activationsubsystem
TestabilitysubsystemFederation
Transport
Application Programming Models
Microservices
Managementsubsystem
![Page 25: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/25.jpg)
Nodes failed
Machine failure detection
Time = t1
83 76 50 4664 New Node arrived61
Time = t2
8361
50 46Failures Detected
cluster reconfigured
83 76 6450 46
Time = t0
![Page 26: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/26.jpg)
Queues Storage
3-TIER SERVICE PATTERN
Front 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 27: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/27.jpg)
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 28: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/28.jpg)
Stateful microservices are reliable and consistent
Each service is backed by replica set to make its internal state reliable All replicas are logically consistent – meaning all replicas see the same linearised order of read and write operations to initial stateRead-Write quorums are supported and are dynamically adjustedReplica set is dynamically reconfigured to account for replica arrivals and departures
![Page 29: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/29.jpg)
Stateful microserviceApplication Package
PSSreplication
replication
PSS
![Page 30: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/30.jpg)
ReplicationReads are completed at the primaryWrites are replicated to the write quorum of secondaries
P
S
S
S
SWriteWrite
WriteWrite
AckAck AckAck
ReadValue WriteAck
![Page 31: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/31.jpg)
ReconfigurationTypes of reconfiguration• Primary failover• Removing a failed secondary • Adding recovered replica• Building a new secondary
Replica States• None• Idle Secondary • Active Secondary• Primary
P
S
S
S
S
S
Must be safe in the presence of cascading failures
B PXFailed
XFailed
![Page 32: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/32.jpg)
Demo: Stateful MicroserviceCausing Chaos…
![Page 33: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/33.jpg)
Upgrading Applications
![Page 34: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/34.jpg)
APPLICATION: LOGICAL GROUPING OF MICROSERVICES
Application Container Container
Container
Container
![Page 35: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/35.jpg)
Upgrading Services with zero downtimeApplication Package
FD0/UD0
FD0/UD1
FD1/UD6
FD1/UD5
FD2/UD4
FD2/UD3
![Page 36: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/36.jpg)
Demo: No Downtime Upgrade
![Page 37: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/37.jpg)
Wrapping up… Service Fabric provides a modern consistent framework
for your high demand Solutions. Service Fabric provides higher fidelity management of
Solutions… Logging, Fault tolerance, Upgrades, Restarts, Low
Latency… SCALE!!!!!
![Page 38: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/38.jpg)
Application development in the age of the CloudFeatures
Scalability
Manage ServicesDeliver Features FasterCreate Business Value
AvailabilityLatencyLifecycleData IntegrityPortability
![Page 39: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/39.jpg)
Q&AMick Badran@[email protected]
![Page 40: Service Fabric – building tomorrows applications today](https://reader036.fdocuments.in/reader036/viewer/2022070516/587155b31a28ab8e5b8b5187/html5/thumbnails/40.jpg)
PEOPLE TECHNOLOGY INTEGRATION
Thank you