Download presentation
Presentation is loading. Please wait.
Published byAlexandrina Bradley Modified over 8 years ago
2
Mick Badran Using Microsoft Service Fabric to build your next Solution with zero downtime – Lvl 300 CLD32 5
3
CTO @ MOQdigital Azure MVP, Insider & Advisor @mickba, mbadran@moqdigital.com.aumbadran@moqdigital.com.au Doing mo-vember Who Am I
4
Agenda What is Service Fabric Demo – Stateless and Stateful counters Service Fabric Applications Demo - Reliable Service API Stateful Word count service Service Fabric Clusters Demo – Stateful Microservices – causing chaos Upgrading Apps with no downtime Demo – No Downtime Upgrade Wrap Up…
6
Application development in the age of the Cloud Features Scalability Manage Services Deliver Features Faster Create Business Value Availability Latency Lifecycle Data Integrity Portability
7
Microsoft Azure Service Fabric A platform for reliable, hyperscale, microservice-based applications
8
Battle-hardened for over 5 years
9
What is a microservice? Is (logic + state) that is independently versioned, deployed, and scaled Has a unique name that can be resolved e.g. fabric:/myapplication/myservice Call other Microservices Remains always logically consistent in the presence of failures Hosted inside a “container” (code + config)
10
What can you build with Service Fabric 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
11
Installing Service Fabric
13
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)
14
Demo: Stateful and Stateless Counters
15
Application Package Unit of Lifetime Versioning Isolation Counter Service type Counter WebApp type Defining applications and services Counter Service Pkg Code Config Counter WebApp Pkg Application Type
16
Instantiating an application ServiceType is “like” a.NET CLR type (class CounterServiceType) ApplicationType is “like” a typed Container (CounterAppType : ServiceContainer 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 Service Package B Service Package A Service Package B Service Package A Service Package B Service Package A
17
Reliable Collections Reliable collections make it easy to build stateful services. Evolution of the.NET collections for the cloud
18
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 )
19
Demo: Reliable Service API Stateless Word count service
20
Cloud Services Azure Tables/NoSQL Reliable Azure Queue Service Fabric (Stateful) Word count service Cloud Service vs Stateful Service Fabric
21
Demo: Reliable Service API StateFUL Word count service
23
A set of machines that Service Fabric stitches together to form a cluster Clusters can scale to 1000s of machines Cluster: A federation of machines Node
24
Service Fabric Subsystems Microservices
25
Nodes failed Machine failure detection Time = t 1 83 76 50 46 64 New Node arrived 61 Time = t 2 83 61 50 46 Failures Detected cluster reconfigured 83 76 64 50 46 Time = t 0
26
Queues Storage 3-Tier service pattern Front End (Stateless Web) Stateless Middle-tier Compute 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
27
Stateful Middle-tier Compute Stateful services: Simplify design, reduce latency Front End (Stateless Web) 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
28
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 state Read-Write quorums are supported and are dynamically adjusted Replica set is dynamically reconfigured to account for replica arrivals and departures
29
Stateful microservice Application Package replication
30
Replication Reads are completed at the primary Writes are replicated to the write quorum of secondaries P S S S S Write Ack Read Value Write Ack
31
Reconfiguration Types 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 P Failed
34
Application: logical grouping of microservices Application
35
Application Lifecycle Management Provisioning and deployment of fellow microservices Upgrade microservices without loss of availability Monitor microservices Interface with machine management layer for autoscale and initiating reboot, reimage, and repair actions Provide operational insight into aggregate utilisation – inventory, performance counters/metrics, etc. – for capacity planning
36
Upgrading Services with zero downtime Application Package
39
Application development in the age of the Cloud Features Scalability Manage Services Deliver Features Faster Create Business Value Availability Latency Lifecycle Data Integrity Portability
40
Mick Badran @mickba mbadran@moqdigital.com.au
42
Continue your Ignite learning path Visit Microsoft Virtual Academy for free online training visit https://www.microsoftvirtualacademy.com Visit Channel 9 to access a wide range of Microsoft training and event recordings https://channel9.msdn.com/ Head to the TechNet Eval Centre to download trials of the latest Microsoft products http://Microsoft.com/en-us/evalcenter/
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.