SlideShare a Scribd company logo
Pathway to Cloud-
Native .NET
Modernizing .NET applications to Cloud Native
Robert Sirchia Practice Lead
15.2.2019
2
» App Portfolio Rationalization
» SNAP
» Decomposition
» Steeltoe
› Configuration
› Circuit
› Health
› Service
» Key Takeaways
Agenda
3
Who am I?
Robert is a Lead Consultant with Magenic, heading
up the Magenic Pivotal Practice, and has more than
15 years’ experience with the .NET and Microsoft
technologies. He has been working with Pivotal
Cloud Foundry in the .NET space for more than two
years, and during that time, Robert has led large re-
platforming and modernization efforts in moving
.NET applications to Pivotal Cloud Foundry. He also
has industry experience in real estate, financial
institutions, politics, and energy and chemical.
4
» This isn’t me…
Who I am Not.
5
Who is Magenic
6
What do we got?
Portfolio Rationalization
7
Portfolio Rationalization
Inventory Analyze Catalog Backlog
• All applications
• Ancillary services
• All data sources
• Diagram the
system
• Decompose
functionality
• Catalog the
functionality of
each application
• Identifying
functionality that
crosses apps
• Determine if the
app is still used
• Determine its
business value
• Determine
suitability for the
cloud (SNAP)
• Backlog based on
app inventory and
functionality
catalog
• Organize based
on deprecation or
modernizations
8
Conversational approach of
evaluating the suitability of
moving an app to the cloud.
» Flush out risks
» Outline priorities
» General understand of the
technologies used
» Understand relative sizing
SNAP
9
» Overall for the app
» All of the deploy points
What to SNAP?
My App
Web UI
API 2
API 1
My App
XXL
Web UI
S
API 1
L
API 2
XXL
10
» Event storming
› Workshop method used to understand domains in a system
› People
− Business: those who understand events in business process
− Technical: those who understand where the bodies are buried
› Stickies
− Orange: Events
− Blue: Commands
− Yellow: Aggregates
− Purple: trouble spots
› Select services
− Start small to prove out SDLC
− Then ramp up to higher value
Decomposition
11
Event Storming
Customer Party
Size and Name
Recorded
What do we do
if no seats are
available?
Drinks Ordered
Food Ordered
Drinks Served
Order Queued Food Served
Food EatenFood Cooked
Food Staged
Bill Presented
Bill Paid
Order Drinks Queue Order Present BillRing BellSeat Requested
Customer
Seated
Pay Bill
What do we do
if payment is
declined?
12
Event Storming
Bill Presented
Bill Paid
Present Bill
Pay Bill
What do we do
if payment is
declined?
13
» Identifying and catalog functionality
for each application
› On such platforms like Confluence
» Evaluate proposed efforts against
any existing functionality
› Consider centralizing functionality if
possible that crosses applications
» Update the catalog frequently
Cataloging
14
Cloud Native Frameworks
Fast Open Source Way to the Cloud
15
Is an open source framework of Cloud-native
libraries for implementing industry standard
best practices when building microservices
for the cloud.
» .NET Core and .NET Framework
» Runs on Windows and Linux
» Works with or without Pivotal Cloud Foundry
Steeltoe
16
Configuration
Configuration enables developers to configure an application with values from a variety
of sources by using Configuration Providers. Each provider supports reading a set of
name-value pairs from a given source location and adding them into a combined multi-
level configuration dictionary.
17
» Configuration Server
› Centralized configurations
› Served through Config Server
› Stored in Vault, GIT, or local file system
Spring Cloud Configuration Server
Java
App
.NET
App
Java
App
18
» Add Cloud Foundry in Program.cs
» Configure Options in Startup.cs
» Inject in to your class
» Get values you need
Implementing Configuration Provider in .NET
public void ConfigureServices(IServiceCollection services)
{
services.AddOptions();
services.ConfigureCloudFoundryOptions(Configuration);
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new string[]
{
_applicationOptions.Application_Name,
_servicesOptions.Services["value"].ToString()
};
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.AddCloudFoundry()
.UseStartup<Startup>();
public ValuesController(IOptions<CloudFoundryApplicationOptions> applicationOptions,
IOptions<CloudFoundryServicesOptions> servicesOptions)
{
_applicationOptions = applicationOptions.Value;
_servicesOptions = servicesOptions.Value;
}
19
Service Registration and Discovery
A service registry provides a database that applications can use to implement the
Service Discovery pattern, one of the key tenets of a microservices-based architecture.
Applications can use a service registry to dynamically discover and call registered
services.
20
» Based on Netflix Eureka
» Centralized service registry
» Basic health checking
» Useful for container to container
(C2C)
Service Discovery
Consumer
Service
Registry
Producer
Producer
Producer
Producer
Producer
Register
Discover
Connect
21
Implementing Service Discovery in .NET
» Client rewrites hostname portion
of URL with an actual service node
» Create a new Discovery Handler
» Call the service
DiscoveryHttpClientHandler _handler;
ILogger<AccountService> _logger;
private const string ACCOUNT_URL = "http://accountService/api/account";
public AccountService(IDiscoveryClient client, ILoggerFactory logFactory)
{
_handler = new DiscoveryHttpClientHandler(client,
logFactory.CreateLogger<DiscoveryHttpClientHandler>());
_logger = logFactory.CreateLogger<AccountService>();
}
public async Task<string> GetAccountName()
{
var client = GetClient();
var result = await client.GetStringAsync(ACCOUNT_URL);
_logger.LogInformation("AccountName: {0}", result);
return result;
}
private HttpClient GetClient()
{
var client = new HttpClient(_handler, false);
return client;
}
22
Circuit Breaking
Cloud-native architectures typically consist of multiple layers of distributed services.
End-user requests may require multiple calls to these services, and failures in lower-
level services can spread to other dependent services and cascade up to the end user.
Heavy traffic to a failing service can also make it difficult to repair. By using Circuit
Breaker frameworks, you can prevent failures from cascading and provide fallback
behavior until a failing service is restored to normal operation.
23
» Based on Netflix Hystrix
» Designed to prevent
cascading failures
» Gives live metrics on state
» Maintaining three states
» Used to fail gracefully and with
a known failure state
» Opens a circuit on
› Timeout
› failure
Circuit Breaker
Closed
Half-Open
Open
Trip breaker
Attempt
reset
Trip
breaker
Reset
24
public class AccountCommand : HystrixCommand<Account>
{
private readonly ILogger<AccountCommand> _logger;
private readonly IAccountService _accountService;
private string _accountId;
public AccountCommand(IHystrixCommandOptions options, ILogger<AccountCommand> logger,
IAccountService accountService) : base(options)
{
_logger = logger;
_accountService = accountService;
}
public async Task<Account> GetAccount(string accountId)
{
_accountId = accountId;
return await Execute sync();
}
protected override async Task<Account> RunAsync()
{
return await _accountService.GetAccount(_accountId);
}
protected override async Task<Account> RunFallbackAsync()
{
_logger.LogError("Couldn't get account");
return await Task.FromResult(new Account());
}
}
» Extend HystrixCommand
» Add an Execute method
» RunAsync (Circuit Closed)
› What executes normally
» RunFallbackAsync (Circuit Open)
› What executes under failure
Implementing a Circuit Breaker in .NET
25
Management
Both frameworks have a number of management endpoints that you can easily add to
your application. The way the endpoints are exposed and used depends on the type of
technology you choose in exposing the functionality of the endpoint.
26
» Helps with monitoring and managing services in production
» Can be exposed via HTTP and integrate with Pivotal Apps Manager
» Customizable endpoints
› Settings
› Health
› Info
› Loggers
› Tracing
› etc.
Management
27
» Quick way to check the
status of an application
» Customize to monitor
› Underlying services
› External services
› Messaging systems
» Used to tie in to existing
monitoring tools
Health Management
Service 3
Service 1
Health Check
OK
Health Check
Database is not
online
Database
28
» Completely open source
» Active user community
› Dedicated Slack channel
› Open Pivotal Tracker
» Examples and sample code in GitHub
Open and Engaged
29
» Using techniques to understand your portfolio of applications
» Get started sooner and in the correct place
» Use the tools to optimize applications to the cloud
Key Takeaways
30
Appendix

More Related Content

PDF
Developing functional domain models with event sourcing (sbtb, sbtb2015)
PPT
DDD Framework for Java: JdonFramework
PDF
How to write your database: the story about Event Store
PPTX
Introduction to Distributed Architecture
PDF
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
PDF
PDF
PredictionIO - Scalable Machine Learning Architecture
PDF
the Indivo X iOS Framework
Developing functional domain models with event sourcing (sbtb, sbtb2015)
DDD Framework for Java: JdonFramework
How to write your database: the story about Event Store
Introduction to Distributed Architecture
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
PredictionIO - Scalable Machine Learning Architecture
the Indivo X iOS Framework

What's hot (20)

PDF
Redux data flow with angular
PDF
#JaxLondon: Building microservices with Scala, functional domain models and S...
PPTX
Context Information Management in IoT enabled smart systems - the basics
PPTX
Orion Context Broker 20210907
PDF
Loggly - Case Study - Loggly and Kubernetes Give Molecule Easy Access to the ...
PDF
Redux data flow with angular
PDF
Developing functional domain models with event sourcing (oakjug, sfscala)
PDF
CQRS and Event Sourcing with Akka, Cassandra and RabbitMQ
PDF
APAC Confluent Consumer Data Right the Lowdown and the Lessons
PDF
PredictionIO - Building Applications That Predict User Behavior Through Big D...
PPTX
Cqrs, Event Sourcing
PDF
Microservice Architecture with CQRS and Event Sourcing
PPTX
Orion Context Broker 20210412
PDF
CQRS & event sourcing in the wild
PDF
[WSO2Con EU 2018] The Rise of Streaming SQL
PDF
Redis + Structured Streaming—A Perfect Combination to Scale-Out Your Continuo...
PPTX
Orion Context Broker
PDF
Kafka Summit SF 2017 - From Scaling Nightmare to Stream Dream : Real-time Str...
PDF
#SlimScalding - Less Memory is More Capacity
PPTX
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Redux data flow with angular
#JaxLondon: Building microservices with Scala, functional domain models and S...
Context Information Management in IoT enabled smart systems - the basics
Orion Context Broker 20210907
Loggly - Case Study - Loggly and Kubernetes Give Molecule Easy Access to the ...
Redux data flow with angular
Developing functional domain models with event sourcing (oakjug, sfscala)
CQRS and Event Sourcing with Akka, Cassandra and RabbitMQ
APAC Confluent Consumer Data Right the Lowdown and the Lessons
PredictionIO - Building Applications That Predict User Behavior Through Big D...
Cqrs, Event Sourcing
Microservice Architecture with CQRS and Event Sourcing
Orion Context Broker 20210412
CQRS & event sourcing in the wild
[WSO2Con EU 2018] The Rise of Streaming SQL
Redis + Structured Streaming—A Perfect Combination to Scale-Out Your Continuo...
Orion Context Broker
Kafka Summit SF 2017 - From Scaling Nightmare to Stream Dream : Real-time Str...
#SlimScalding - Less Memory is More Capacity
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Ad

Similar to Pathway to Cloud-Native .NET (20)

PDF
Bringing Microservices to .NET: Modernizing Windows Applications as Cloud-Native
PDF
Easy integration of Bluemix services with your applications
PPTX
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
PPTX
AppliFire Blue Print Design Guidelines
PDF
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
PPTX
CQRS and Event Sourcing
PDF
Microservices - Hitchhiker's guide to cloud native applications
PPTX
Splunk Ninjas: New Features, Pivot, and Search Dojo
PDF
Microservices and modularity with java
PDF
Apex Enterprise Patterns: Building Strong Foundations
PPTX
From Zero to Serverless
PDF
Intershop Commerce Management with Microsoft SQL Server
PDF
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
PPTX
성공적인 서비스로의 플랫폼 선택
PPTX
Cytoscape CI Chapter 2
PDF
Observability foundations in dynamically evolving architectures
PDF
Comment transformer vos données en informations exploitables
PDF
OutSystsems User Group Netherlands September 2024.pdf
PPTX
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
PPTX
Ibm xamarin gtruty
Bringing Microservices to .NET: Modernizing Windows Applications as Cloud-Native
Easy integration of Bluemix services with your applications
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
AppliFire Blue Print Design Guidelines
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
CQRS and Event Sourcing
Microservices - Hitchhiker's guide to cloud native applications
Splunk Ninjas: New Features, Pivot, and Search Dojo
Microservices and modularity with java
Apex Enterprise Patterns: Building Strong Foundations
From Zero to Serverless
Intershop Commerce Management with Microsoft SQL Server
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
성공적인 서비스로의 플랫폼 선택
Cytoscape CI Chapter 2
Observability foundations in dynamically evolving architectures
Comment transformer vos données en informations exploitables
OutSystsems User Group Netherlands September 2024.pdf
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
Ibm xamarin gtruty
Ad

More from VMware Tanzu (20)

PDF
Spring into AI presented by Dan Vega 5/14
PDF
What AI Means For Your Product Strategy And What To Do About It
PDF
Make the Right Thing the Obvious Thing at Cardinal Health 2023
PPTX
Enhancing DevEx and Simplifying Operations at Scale
PDF
Spring Update | July 2023
PPTX
Platforms, Platform Engineering, & Platform as a Product
PPTX
Building Cloud Ready Apps
PDF
Spring Boot 3 And Beyond
PDF
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
PDF
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
PDF
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
PPTX
tanzu_developer_connect.pptx
PDF
Tanzu Virtual Developer Connect Workshop - French
PDF
Tanzu Developer Connect Workshop - English
PDF
Virtual Developer Connect Workshop - English
PDF
Tanzu Developer Connect - French
PDF
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
PDF
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
PDF
SpringOne Tour: The Influential Software Engineer
PDF
SpringOne Tour: Domain-Driven Design: Theory vs Practice
Spring into AI presented by Dan Vega 5/14
What AI Means For Your Product Strategy And What To Do About It
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Enhancing DevEx and Simplifying Operations at Scale
Spring Update | July 2023
Platforms, Platform Engineering, & Platform as a Product
Building Cloud Ready Apps
Spring Boot 3 And Beyond
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
tanzu_developer_connect.pptx
Tanzu Virtual Developer Connect Workshop - French
Tanzu Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
Tanzu Developer Connect - French
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: Domain-Driven Design: Theory vs Practice

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
System and Network Administration Chapter 2
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
System and Network Administraation Chapter 3
PPTX
ai tools demonstartion for schools and inter college
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
history of c programming in notes for students .pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
assetexplorer- product-overview - presentation
PPTX
L1 - Introduction to python Backend.pptx
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
top salesforce developer skills in 2025.pdf
Odoo Companies in India – Driving Business Transformation.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Internet Downloader Manager (IDM) Crack 6.42 Build 41
System and Network Administration Chapter 2
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
System and Network Administraation Chapter 3
ai tools demonstartion for schools and inter college
Designing Intelligence for the Shop Floor.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
history of c programming in notes for students .pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Design an Analysis of Algorithms II-SECS-1021-03
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
assetexplorer- product-overview - presentation
L1 - Introduction to python Backend.pptx
wealthsignaloriginal-com-DS-text-... (1).pdf
How to Migrate SBCGlobal Email to Yahoo Easily
top salesforce developer skills in 2025.pdf

Pathway to Cloud-Native .NET

  • 1. Pathway to Cloud- Native .NET Modernizing .NET applications to Cloud Native Robert Sirchia Practice Lead 15.2.2019
  • 2. 2 » App Portfolio Rationalization » SNAP » Decomposition » Steeltoe › Configuration › Circuit › Health › Service » Key Takeaways Agenda
  • 3. 3 Who am I? Robert is a Lead Consultant with Magenic, heading up the Magenic Pivotal Practice, and has more than 15 years’ experience with the .NET and Microsoft technologies. He has been working with Pivotal Cloud Foundry in the .NET space for more than two years, and during that time, Robert has led large re- platforming and modernization efforts in moving .NET applications to Pivotal Cloud Foundry. He also has industry experience in real estate, financial institutions, politics, and energy and chemical.
  • 4. 4 » This isn’t me… Who I am Not.
  • 6. 6 What do we got? Portfolio Rationalization
  • 7. 7 Portfolio Rationalization Inventory Analyze Catalog Backlog • All applications • Ancillary services • All data sources • Diagram the system • Decompose functionality • Catalog the functionality of each application • Identifying functionality that crosses apps • Determine if the app is still used • Determine its business value • Determine suitability for the cloud (SNAP) • Backlog based on app inventory and functionality catalog • Organize based on deprecation or modernizations
  • 8. 8 Conversational approach of evaluating the suitability of moving an app to the cloud. » Flush out risks » Outline priorities » General understand of the technologies used » Understand relative sizing SNAP
  • 9. 9 » Overall for the app » All of the deploy points What to SNAP? My App Web UI API 2 API 1 My App XXL Web UI S API 1 L API 2 XXL
  • 10. 10 » Event storming › Workshop method used to understand domains in a system › People − Business: those who understand events in business process − Technical: those who understand where the bodies are buried › Stickies − Orange: Events − Blue: Commands − Yellow: Aggregates − Purple: trouble spots › Select services − Start small to prove out SDLC − Then ramp up to higher value Decomposition
  • 11. 11 Event Storming Customer Party Size and Name Recorded What do we do if no seats are available? Drinks Ordered Food Ordered Drinks Served Order Queued Food Served Food EatenFood Cooked Food Staged Bill Presented Bill Paid Order Drinks Queue Order Present BillRing BellSeat Requested Customer Seated Pay Bill What do we do if payment is declined?
  • 12. 12 Event Storming Bill Presented Bill Paid Present Bill Pay Bill What do we do if payment is declined?
  • 13. 13 » Identifying and catalog functionality for each application › On such platforms like Confluence » Evaluate proposed efforts against any existing functionality › Consider centralizing functionality if possible that crosses applications » Update the catalog frequently Cataloging
  • 14. 14 Cloud Native Frameworks Fast Open Source Way to the Cloud
  • 15. 15 Is an open source framework of Cloud-native libraries for implementing industry standard best practices when building microservices for the cloud. » .NET Core and .NET Framework » Runs on Windows and Linux » Works with or without Pivotal Cloud Foundry Steeltoe
  • 16. 16 Configuration Configuration enables developers to configure an application with values from a variety of sources by using Configuration Providers. Each provider supports reading a set of name-value pairs from a given source location and adding them into a combined multi- level configuration dictionary.
  • 17. 17 » Configuration Server › Centralized configurations › Served through Config Server › Stored in Vault, GIT, or local file system Spring Cloud Configuration Server Java App .NET App Java App
  • 18. 18 » Add Cloud Foundry in Program.cs » Configure Options in Startup.cs » Inject in to your class » Get values you need Implementing Configuration Provider in .NET public void ConfigureServices(IServiceCollection services) { services.AddOptions(); services.ConfigureCloudFoundryOptions(Configuration); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); } [HttpGet] public ActionResult<IEnumerable<string>> Get() { return new string[] { _applicationOptions.Application_Name, _servicesOptions.Services["value"].ToString() }; } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .AddCloudFoundry() .UseStartup<Startup>(); public ValuesController(IOptions<CloudFoundryApplicationOptions> applicationOptions, IOptions<CloudFoundryServicesOptions> servicesOptions) { _applicationOptions = applicationOptions.Value; _servicesOptions = servicesOptions.Value; }
  • 19. 19 Service Registration and Discovery A service registry provides a database that applications can use to implement the Service Discovery pattern, one of the key tenets of a microservices-based architecture. Applications can use a service registry to dynamically discover and call registered services.
  • 20. 20 » Based on Netflix Eureka » Centralized service registry » Basic health checking » Useful for container to container (C2C) Service Discovery Consumer Service Registry Producer Producer Producer Producer Producer Register Discover Connect
  • 21. 21 Implementing Service Discovery in .NET » Client rewrites hostname portion of URL with an actual service node » Create a new Discovery Handler » Call the service DiscoveryHttpClientHandler _handler; ILogger<AccountService> _logger; private const string ACCOUNT_URL = "http://accountService/api/account"; public AccountService(IDiscoveryClient client, ILoggerFactory logFactory) { _handler = new DiscoveryHttpClientHandler(client, logFactory.CreateLogger<DiscoveryHttpClientHandler>()); _logger = logFactory.CreateLogger<AccountService>(); } public async Task<string> GetAccountName() { var client = GetClient(); var result = await client.GetStringAsync(ACCOUNT_URL); _logger.LogInformation("AccountName: {0}", result); return result; } private HttpClient GetClient() { var client = new HttpClient(_handler, false); return client; }
  • 22. 22 Circuit Breaking Cloud-native architectures typically consist of multiple layers of distributed services. End-user requests may require multiple calls to these services, and failures in lower- level services can spread to other dependent services and cascade up to the end user. Heavy traffic to a failing service can also make it difficult to repair. By using Circuit Breaker frameworks, you can prevent failures from cascading and provide fallback behavior until a failing service is restored to normal operation.
  • 23. 23 » Based on Netflix Hystrix » Designed to prevent cascading failures » Gives live metrics on state » Maintaining three states » Used to fail gracefully and with a known failure state » Opens a circuit on › Timeout › failure Circuit Breaker Closed Half-Open Open Trip breaker Attempt reset Trip breaker Reset
  • 24. 24 public class AccountCommand : HystrixCommand<Account> { private readonly ILogger<AccountCommand> _logger; private readonly IAccountService _accountService; private string _accountId; public AccountCommand(IHystrixCommandOptions options, ILogger<AccountCommand> logger, IAccountService accountService) : base(options) { _logger = logger; _accountService = accountService; } public async Task<Account> GetAccount(string accountId) { _accountId = accountId; return await Execute sync(); } protected override async Task<Account> RunAsync() { return await _accountService.GetAccount(_accountId); } protected override async Task<Account> RunFallbackAsync() { _logger.LogError("Couldn't get account"); return await Task.FromResult(new Account()); } } » Extend HystrixCommand » Add an Execute method » RunAsync (Circuit Closed) › What executes normally » RunFallbackAsync (Circuit Open) › What executes under failure Implementing a Circuit Breaker in .NET
  • 25. 25 Management Both frameworks have a number of management endpoints that you can easily add to your application. The way the endpoints are exposed and used depends on the type of technology you choose in exposing the functionality of the endpoint.
  • 26. 26 » Helps with monitoring and managing services in production » Can be exposed via HTTP and integrate with Pivotal Apps Manager » Customizable endpoints › Settings › Health › Info › Loggers › Tracing › etc. Management
  • 27. 27 » Quick way to check the status of an application » Customize to monitor › Underlying services › External services › Messaging systems » Used to tie in to existing monitoring tools Health Management Service 3 Service 1 Health Check OK Health Check Database is not online Database
  • 28. 28 » Completely open source » Active user community › Dedicated Slack channel › Open Pivotal Tracker » Examples and sample code in GitHub Open and Engaged
  • 29. 29 » Using techniques to understand your portfolio of applications » Get started sooner and in the correct place » Use the tools to optimize applications to the cloud Key Takeaways