Creating highly available and resilient Microservices on Microsoft Azure Service Fabric

Slides:



Advertisements
Similar presentations
Microsoft Ignite /16/2017 2:42 PM
Advertisements

Features Scalability Availability Latency Lifecycle Data Integrity Portability Manage Services Deliver Features Faster Create Business Value.
Build /16/2017 © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION.
Building Resilient, Scalable Services with Microsoft Azure Service Fabric Mark Fussell Principal Program Manager Vipul Modi Principal Software.
Overview Of Microsoft New Technology ENTER. Processing....
Manage & Configure SQL Database on the Cloud Haishi Bai Technical Evangelist Microsoft.
Austin code camp 2010 asp.net apps with azure table storage PRESENTED BY CHANDER SHEKHAR DHALL
Building micro-service based applications using Azure Service Fabric
The microservices approach Scales by cloning the app on multiple servers/VMs/Containers Monolithic application approach Microservices application.
Pierre Sleep tight knowing you’re prepared for outages Protect your environment with Azure ARC32 4.
Windows Azure. Azure Application platform for the public cloud. Windows Azure is an operating system You can: – build a web application that runs.
Michael Kelley Linux on the Microsoft Cloud Platform CLD24 3.
Luke Notley Migrating from AWS to Azure Seamlessly CLD32 1.
Andrew Hennessy Automating Server Application migrations to the Cloud – Goodbye Server INF21 3.
Kevin Francis Developing on Windows Devices ARC33 2.
Chris Hewitt Adding magic to your business with Perceptual Intelligence ARC323 B.
Matt McSpirit Software-defined Networking in Windows Server 2016 INF32 4.
Martin Cairney Hybrid data platform – making the most of Azure plus your on- prem kit DAT341 B.
Vakhtang Assatrian Asia Communications TSP Lead, Microsoft Architecture options for implementing Skype for Business PRD32 7.
20409A 7: Installing and Configuring System Center 2012 R2 Virtual Machine Manager Module 7 Installing and Configuring System Center 2012 R2 Virtual.
Alessandro Cardoso, Microsoft MVP Creating your own “Private Cloud” with Windows 10 Hyper- V WIN443.
Michael Porfirio and Chris Gondek Beyond Backup The Next Generation Commvault Data Platform DAT22 5.
Jeff Alexander & Andrew McMurray Runtime Provisioning in Windows 10 WIN327.
Michael Niehaus Using the Windows Store for Business: New Capabilities for Managing Apps in the Enterprise WIN335.
Mahesh Krishnan Architecting highly resilient applications on Azure ARC42 7.
Jessica Payne Microsoft Global Incident Response and Recovery
Dr Greg Low Working with SQL Server Spatial Data DAT33 3.
Azure in a Day Training: Windows Azure Module 1: Windows Azure Overview Module 2: Development Environment / Portal – DEMO: Signing up for Windows Azure.
James Bannan Freddy vs JSON: Azure Resource Manager CLD44 3.
Warwick Rudd – Henry Rooney – How Available is SQL Server 2016? DAT33 6.
Features Scalability Manage Services Deliver Features Faster Create Business Value Availability Latency Lifecycle Data Integrity Portability.
Mick Badran Using Microsoft Service Fabric to build your next Solution with zero downtime – Lvl 300 CLD32 5.
Nick Application Development for the Universal Windows Platform MOB225.
Please note that the session topic has changed
Matt McSpirit Understanding the Azure Stack INF33 2.
Alec Tucker An Introduction to Cross Platform Native App Development using Xamarin to Develop, Test and Monitor MOB227.
Orin Thomas 30 Bad Habits of Server Administrators INF32 3.
Fai Lai Global IoT Tech Specialist, C+E Specialist Sales Seamless communication between devices and Azure IoT Hub via Azure IoT Protocol Gateway MOB31.
Building a Microservices solution using Docker,
Technology Drill Down: Windows Azure Platform Eric Nelson | ISV Application Architect | Microsoft UK |
Basil Apostolou & Craig Pringle The why and how of hybrid cloud CLD22 3.
Kevin Francis Big Building Blocks – a tour of Dynamics ARC323 A.
Joe Clancy Deployment Lifecycles and New Policy Features with the Azure Resource Manager ARC22 1.
James Bannan The Cloud That Chuck Norris Built: Resilient Architecture in Azure ARC44 3.
And scales by cloning the app on multiple servers/VMs/Containers Traditional architecture approach Microservices architecture approach A microservice.
The best of WF 4.0 and AppFabric Damir Dobric MVP-Connected System Developer Microsoft Connected System Division Advisor Visual Studio Inner Circle member.
Sam Vanhoutte CTO Codit, Integration MVP Azure Service Fabric: notes from the field.
Jhong Catane Exchange Hybrid Deployment PRD34 2.
Microservice Best Practices Lessons Learned from Azure Service Fabric Mark Russinovich CTO, Microsoft
3 Ways to Integrate Business Systems to Partners
Build /26/2018 6:17 AM Building Resilient, Scalable Services with Microsoft Azure Service Fabric Érsek © 2015 Microsoft Corporation.
BRK1036 Building applications with Microsoft Azure Service Fabric on Windows and Linux Subramanian Ramaswamy (Mani) Sean McKenna
Microservices with Azure Service Fabric Building and Running Services at Scale
Building a Continuous Delivery Pipeline for ASP.NET Core Apps
Microsoft Azure Service Fabric Overview
Service Fabric Patterns & Best Practices
Microsoft Build /8/2018 5:15 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Developing for the cloud with Visual Studio
Modern cloud PaaS for mobile apps, web sites, API's and business logic apps
Learn. Imagine. Build. .NET Conf
1/2/2019 5:18 PM THR3016 Customer stories: Plan and orchestrate large resource deployments on Azure infrastructure Igal Figlin Principal PM Manager – Azure.
Saranya Sriram Developer Evangelist | Microsoft
Deep Dive into Azure API Apps and Logic Apps
Jonathan Ruckert & Darren Neimke
UI test automation of MVC apps with Microsoft Edge WebDriver
Securing ASP.NET in an Azure Environment
Johan Lindberg, inRiver
Containers on Azure Peter Lasne Sr. Software Development Engineer
Presentation transcript:

Creating highly available and resilient Microservices on Microsoft Azure Service Fabric Mahesh Krishnan CLD334

Agenda Why use microservices? Azure Service Fabric Platform – An introduction Service Fabric Programming model Reliable Actors Reliable Services Wrap up

Traditional Monolithic approach A monolithic application has most of its functionality within a single process that is commonly componentized with libraries Scales by cloning the app on multiple servers/VMs/ containers

Microservices approach Separates functionality into separate smaller services Uses a standard communication protocol Scales out be deploying each service independently creating instances of these services across servers/VMs containers

Why use microservices? Can be versioned, deployed and scaled independently Allows use of different technologies Loose coupling of services Faster delivery of features Facilitates small, focused teams Improves fault isolation

Microsoft Azure Service Fabric A platform for reliable, hyperscale, microservice-based applications microservices Service Fabric Health Monitoring Container Orchestration & lifecycle management High Availability Hybrid Operations Data Partitioning Self-healing Simple programming models High Density Rolling Upgrades Low Latency Placement Constraints Fast startup & shutdown Replication & Failover Load balancing Hyper-Scale Automated Rollback Stateful services Private Clouds Windows Server Linux Azure Windows Server Linux Hosted Clouds Windows Server Linux

Service Fabric cluster with microservices App1 App2

Types of Microservices Stateless microservice Stateful microservices

Stateless Microservices Has either no state or state is persisted externally (such as Azure database or Azure storage) There can be multiple instances of the services e.g. Existing ASP.NET web apps, Azure cloud services

Stateful Microservices State is maintained within the microservice Allows for hot data to be next to the compute State is partitioned for scale Each partition state is replicated for reliability e.g. Database, documents, user profile, shopping cart, etc

Cloud Services vs Service Fabric Azure Cloud services Service Fabric One service instance/VM Multiple microservices/VM Lower compute density High microservice density Slow in deployment and upgrades Faster Slower scaling and DR Fast scaling across the cluster

Programming models

Service fabric applications

Reliable Actors API

Actor programming model Introduced in 1973! An actor is the fundamental unit of computation Does some processing Holds state Communicates with other actors Similar to objects in OOP

Reliable Actors API Build reliable stateless and stateful objects using a virtual Actor programming model Suitable for applications with multiple independent units of scale and compute Automatic state management and turn based concurrency

Reliable Actors Actors have an lD that maps to an object Service Fabric manages nodes and can transparently move actors amongst them (provides HA and scale) Actor methods run via turn based concurrency

Getting started Download the Service Fabric Download Ensure PowerShell is installed and right execution policies set up Run the DevClusterSetup.ps1script to start local cluster

Server side code - Interface public interface IMyActor : IActor { Task<string> DoWorkAsync(); }

Server side code - Implementation public class MyActor : Actor, IMyActor { public async Task<string> DoWorkAsync() … return await Task.FromResult("result"); }

Client side code var app = "fabric:/HelloWorld"; var proxy = ActorProxy.Create<IMyActor> (ActorId.NewId(), app); var result = proxy.DoWorkAsync().Result;

Demo Reliable Actors Microsoft Ignite 2015 4/26/2017 8:23 AM © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Actor Lifecycle

Actor lifecycle - Activation If actor is not active, a new actor is created Its state is then loaded (for stateful actors) OnActivateSync method is called Added to Active Actors table

Actor lifecycle - Deactivation Unused actors removed from the Active Actors table OnDeactivateSync method is called on Actor Once deactivated, objects are garbage collected by CLR

Actor lifecycle – more concepts Scan interval – Time interval between successive scans by Actor runtime for inactive actors (Default: 60 seconds) Idle timeout – Time an actor can be idle before it is deactivated (Default: 60 seconds) ActorGarbageCollection attribute used to change defaults

Reliable Services API

Reliable Services API Write services that are reliable, available, scalable and provide consistency Use Reliable Collections to persist state Communicate using tech of your choice (WCF, WebAPI, ..)

Reliable Collection Can be used to create Stateful services. Features: Multi-machine Replicated (HA) Persistance (durable) Asynchrounous Transactional

Getting started… Only two methods you need to implement to get started. CreateCommunicationListener – Method where the communication stack for the service is defined RunAsync – This is where the Service runs the business logic – similar to WorkerRole’s Run method

Server side code - Implementation public class MyStatelessService : StatelessService { protected override ICommunicationListener CreateCommunicationListener() { …} protected override async Task RunAsync(CancellationToken cancellationToken) { … } }

Reliable Collection var myDictionary = await this.StateManager.GetOrAddAsync <IReliableDictionary<string, long>>("myDictionary"); using (var tx = this.StateManager.CreateTransaction()) { … await myDictionary.AddOrUpdateAsync(tx, "counter", 0, (k, v) => ++v); await tx.CommitAsync(); }

Scalability Can be partitioned for scalability – you choose scheme S Node 1 Node 2 Node 3 Node 4 Node 5 Node 6 S P2 P1 S S S S P3 P4 S S S

Demo Reliable Services

Demo Service Fabric in the portal

Wrap up… Service Fabric is the next generation of PaaS that can be used to create microservices Has 2 programming models: Reliable Actor API Reliable Service API Can create either stateful or stateless services Availability, Scalability, load balancing, etc comes OOB

Complete your session evaluation on My Ignite for your chance to win one of many daily prizes.

Continue your Ignite learning path Microsoft Ignite 2015 4/26/2017 8:23 AM 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/ © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.