Microservices with Azure Service Fabric Building and Running Services at Scale

Slides:



Advertisements
Similar presentations
Building Scalable Web Apps with Windows Azure Name Title Microsoft Corporation.
Advertisements

Microsoft Ignite /16/2017 2:42 PM
Features Scalability Availability Latency Lifecycle Data Integrity Portability Manage Services Deliver Features Faster Create Business Value.
Building Resilient, Scalable Services with Microsoft Azure Service Fabric Mark Fussell Principal Program Manager Vipul Modi Principal Software.
A Windows Azure application runs multiple instances of each role A Windows Azure application behaves correctly when.
The microservices approach Scales by cloning the app on multiple servers/VMs/Containers Monolithic application approach Microservices application.
Creating highly available and resilient Microservices on Microsoft Azure Service Fabric
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.
And scales by cloning the app on multiple servers/VMs/Containers Traditional architecture approach Microservices architecture approach A microservice.
Sam Vanhoutte CTO Codit, Integration MVP Azure Service Fabric: notes from the field.
Microservice Best Practices Lessons Learned from Azure Service Fabric Mark Russinovich CTO, Microsoft
Migrate SQL Server Apps to SQL Azure Cloud DB
Azure.
Microsoft Build /9/2017 5:00 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Microsoft /3/2017 8:37 PM BRK2286 Manage Microsoft Azure Service Fabric Applications on Public and Private Cloud Chacko Daniel Principal.
IT Operations Management
1/27/2018 5:13 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Run Azure Services in your datacenter
IT Operations Management
Hybrid Management and Security
Building ARM IaaS Application Environment
4/24/ :07 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
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
Azure Service Fabric: A million containers and counting….
Microsoft Virtual Academy
Developing Hybrid Apps on Microsoft Azure Stack
IoT at the Edge Technical guidance deck.
IT Operations Management
IT Operations Management
Azure.
Required 9s and data protection: introduction to sql server 2012 alwayson, new high availability solution Santosh Balasubramanian Senior Program Manager.
Microsoft Azure Service Fabric Overview
Service Fabric Patterns & Best Practices
Cloud Database Based on SQL Server 2012 Technologies
9/20/ :55 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Melbourne Azure Meetup
IoT at the Edge Technical guidance deck.
Microsoft Build /8/2018 5:15 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Introduction to Windows Azure Web Sites
Cloud? It's All about the App!
Cloud? It's All about the App!
Microsoft Virtual Academy
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Developing for the cloud with Visual Studio
Microsoft Virtual Academy
Learn. Imagine. Build. .NET Conf
Microsoft Virtual Academy
Introduction to Building Applications with Windows Azure
1/2/2019 5:18 PM THR3016 Customer stories: Plan and orchestrate large resource deployments on Azure infrastructure Igal Figlin Principal PM Manager – Azure.
Microsoft Virtual Academy
Microsoft Virtual Academy
MDC-B203 Deploying Applications in Microsoft System Center Virtual Machine Manager Using Services John Messec Program Manager Microsoft.
Developing for Windows Azure
Windows Azure Overview
TechEd /23/2019 9:23 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Service Template Creation from the Ground Up
Developing Windows Azure Applications with Visual Studio
Windows Azure Hybrid Architectures and Patterns
Service Template Creation from the Ground Up
*AZs available across US, Europe and Asia
Day 2, Session 2 Connecting System Center to the Public Cloud
Microsoft Virtual Academy
Office 365 Development July 2014.
Making Windows Azure Relevant to IT Professionals
Microsoft Virtual Academy
Microsoft Virtual Academy
Johan Lindberg, inRiver
Containers on Azure Peter Lasne Sr. Software Development Engineer
Presentation transcript:

Microservices with Azure Service Fabric Building and Running Services at Scale Matt Snider #AzureServiceFabric

Microservices vs. Monoliths

Monolithic application approach Microservices application approach A monolithic application has most of its functionality within a few processes that are componentized with libraries. Scales by cloning the app on multiple servers/VMs/Containers App 1 App 1 App 2 A microservice application separates functionality into separate smaller services. Scales out by deploying each service independently creating instances of these services across servers/VMs/containers

State in Monolithic approach State in Microservices approach Single monolithic database Tiers of specific technologies Graph of interconnected microservices State typically scoped to the microservice Variety of technologies used Remote Storage for cold data stateless services with separate stores stateful services stateless presentation services stateless services

What Is Azure Service Fabric?

5/29/2018 Microsoft Azure Service Fabric A platform for reliable, hyperscale, microservice-based applications Microservices Service Fabric Health Monitoring Code Orchestration & Lifecycle Management High Availability Hybrid Operations Data Partitioning Self-healing Simple programming models Rolling Upgrades Low Latency Replication & Failover High Density Placement Constraints Fast Startup & Shutdown Stateful Services Resource Management Hyper-Scale Automated Rollback Private cloud Azure Other clouds © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Comparing Azure Cloud Services vs. Azure Service Fabric 5/29/2018 5:15 PM Comparing Azure Cloud Services vs. Azure Service Fabric Azure Cloud Services (Web and Worker Roles) Azure Service Fabric (Stateless, stateful or Actor services) 1 role instance per VM Uneven utilization Low density Slow deployment & upgrade (bound to VM) Slow scaling and failure recovery Limited fault tolerance Many microservices per VM Even Utilization (by default, customizable) High density (customizable) Fast deployment & upgrade Fast scaling of independent microservices Tunable fast fault tolerance © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Cluster Set of OS instances (real or virtual) stitched together to form a pool of resources Cluster can scale to 1000s of machines, is self repairing, and scales-up or down Acts as environment-independent abstraction layer Windows OS Fabric Node

Service type Services types are composed of code/config/data packages Code packages define an entry point (dll or exe) Config packages define service specific config information Data packages define static resources (eg. images) Packages can be independently versioned <ServiceManifest Name="QueueService" Version="1.0"> <ServiceTypes> <StatefulServiceType ServiceTypeName="QueueServiceType" HasPersistedState="true" /> </ServiceTypes> <CodePackage Name="Code" Version="1.0"> <EntryPoint> <ExeHost> <Program>ServiceHost.exe</Program> </ExeHost> </EntryPoint> </CodePackage> <ConfigPackage Name="Config" Version="1.0" /> <DataPackage Name="Data" Version="1.0" /> </ServiceManifest> Service Type 1 Code Config Data

Application type Declarative template for creating an application Based on a set of service types Used for packaging, deployment, and versioning Application Type A Service Type 1 Service Type 2 Service Type 3 Code Config Data Code Config Data Code Config Data

Updates Since //Build 2015 Now In Public Preview 5/29/2018 5:15 PM Updates Since //Build 2015 Now In Public Preview Create Clusters via ARM & Portal Hosted Clusters in Azure Many Performance, Density, & Scale Improvements Many API Improvements New Previews Linux Support Java Support Docker & Windows Containers On Premises Clusters © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Microservices with Azure Service Fabric

Service Fabric Microservices App1 App2 App Type Packages Service Fabric Cluster VMs

Handling Machine Failures App1 App2 App Type Packages Service Fabric Cluster VMs

Stateful Microservices - Replication Primary Secondary Replication Service Fabric Cluster VMs

Service Fabric Programming Models Guest Executables Bring any exe Any language Any programming model Packaged as Application Gets versioning, upgrade, monitoring, health, etc. Reliable Services Stateless & stateful services Concurrent, granular state changes Use of the Reliable Collections Transactions across collections Full platform integration Reliable Actors Stateless & stateful actor objects Simplified programming model Single Threaded model Great for scaled out compute and state

Programming models: Reliable Services Reliable collections make it easy to build stateful services An evolution of .NET collections - for the cloud ReliableDictionary<T1,T2> and ReliableQueue<T> Collections Single machine Single-threaded Concurrent Collections Single machine Multi-threaded Reliable Collections Multi-machine Replicated (HA) Persistence (durable) Asynchronous Transactional

Transactionally Modifying Reliable Data protected override async Task RunAsync(CancellationToken cancellationToke) {     var requestQueue = await this.StateManager.GetOrAddAsync<IReliableQueue<CustomerRecord>>(“requests");     var locationDictionary = await this.StateManager.GetOrAddAsync<IReliableDictionary<Guid, LocationInfo>>(“locs");     var personDictionary = await this.StateManager.GetOrAddAsync<IReliableDictionary<Guid, Person>>(“ppl");     var customerListDictionary = await this.StateManager.GetOrAddAsync<IReliableDictionary<Guid, object>>(“customers");     while (true)     {         cancellationToke.ThrowIfCancellationRequested();         Guid customerId = Guid.NewGuid();         using (var tx = this.StateManager.CreateTransaction())         {             var customerRequestResult = await requestQueue.TryDequeueAsync(tx);             await customerListDictionary.AddAsync(tx, customerId, new object());             await personDictionary.AddAsync(tx, customerId, customerRequestResult.Value.person);             await locationDictionary.AddAsync(tx, customerId, customerRequestResult.Value.locInfo);             await tx.CommitAsync();         }     } } Everything happens or nothing happens!

Programming models: Reliable Actors Independent units of compute and state Large number of them executing in parallel Communicates using asynchronous messaging Single threaded execution Automatically created and dehydrated as necessary

Running Microservices at Scale

Service partitioning Services can be partitioned for scale-out. 5/29/2018 5:15 PM Service partitioning Services can be partitioned for scale-out. You can choose your own partitioning scheme. Service partitions are striped across machines in the cluster. Replicas automatically scale out & in on cluster changes Node 1 Node 2 Node 3 Node 4 Node 5 Node 6 S P2 P1 S S S S P3 P4 S S S © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Monitoring your Services Visibility into how your services are doing when running in production Health status monitoring Built-in health status for cluster and services Flexible and extensible health store for custom app health reporting Allows continuous monitoring for real-time alerting on problems in production Performance and stress response Rich built-in metrics for Actors and Services programming models Easy to add custom application performance metrics

Diagnostics and Troubleshooting Repair suggestions. Examples: Slow RunAsync cancellations, RunAsync failures All important events logged. Examples: App creation, deploy and upgrade records. All Actor method calls. Detailed System Optics ETW == Fast Industry Standard Logging Technology Works across environments. Same tracing code runs on devbox and also on production clusters on Azure. Easy to add and system appends all the needed metadata such as node, app, service, and partition. Custom Application Tracing Visual Studio Diagnostics Events Viewer Windows Event Viewer Windows Azure Diagnostics + Operational Insights Easy to plug in your preferred tools: Kibana, Elasticsearch and more Choice of Tools

Application Upgrade App Repository Windows OS Upgrade Domain #1 Fabric Node App A v1 App C v2 App C v1 App A v1 App B v2 App B v2 App C v2 App C v1 App C v1 App C v2 App B v2 App B v2 App C v2 App C v1 App A v1 App A v1

Real Customers and Workloads

Billions of transactions/week Azure Core Infrastructure Services built with Service Fabric Skype for Business Hybrid Ops Azure Document DB Billions of transactions/week Intune 800k+ devices Azure Core Infrastructure Event Hubs 20bn events/day Bing Cortana 500m evals/sec Azure SQL Database 1.4 million databases Power BI More! IoT

300+ Service Fabric Preview Customers

Conclusion

Takeaways Microservices enable development and management flexibility Service Fabric is the platform for building applications with a microservices design approach Service Fabric is battle tested and provides a rich platform for both development and management of services at scale

Q&A

Call to Action Code With Service Fabric SDK Check out the Sample Code http://aka.ms/ServiceFabric Check out the Sample Code http://github.com/Azure/ServiceFabric-Samples Read the Docs http://aka.ms/ServiceFabricDocs Try Service Fabric for Free http://aka.ms/TryServiceFabric

5/29/2018 5:15 PM THANKS! © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.