Building a new application with the latest and greatest methodologies and frameworks? Sounds like fun! Modernizing the legacy .NET applications that have been driving your business for years? Sounds…painful.
Fortunately, a number of new technologies have emerged for the .NET ecosystem to support cloud-native .NET applications, and the processes for analyzing and modernizing them have matured.
In this webinar, join Magenic's Robert Sirchia and Pivotal's Chris Umbel to learn about modernizing .NET applications from a legacy Windows environment. The session will cover topics like:
- How can I determine which .NET applications from my portfolio to modernize?
- How do I decompose a monolithic .NET application into logical business domains?
- Which technologies, like Steeltoe, are available to adopt modern microservices architectures for .NET applications?
- How do I analyze the cloud-suitability of a portfolio of applications and prioritize it for modernization?
Presenters : Robert Sirchia, Magenic and Chris Umbel, Pivotal
4. 44
» Replatforming: lift and shift
» Modernization: refactoring and decomposition
Replatforming and Modernization
5. 55
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
6. 66
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
7. 77
» Event storming
› Alberto Brandolini
› 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
8. 88
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?
10. 1010
» Identifying and catalog functionality for each application
› On such platforms like Confluence or Tettra
» Evaluate proposed efforts against any existing functionality
› Consider centralizing functionality if possible that crosses applications
» Update the catalog frequently
Cataloging
11. 1111
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
12. 1212
» Based on Spring Cloud Config Server
» Designed to externalize configuration
» Designed to centralize configuration
» Supported backends
› git
› Vault
Configuration
App 1 App 2 App 3
13. 1313
» Add Cloud Foundry in Program.cs
» Configure Options in Startup.cs
» Inject in to the controller
» Get values
Implementing Configuration
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;
}
14. 1414
» 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
Circuit Breaker
Closed
Half-Open
Open
Trip breaker
Attempt
reset
Trip
breaker
Reset
16. 1616
» 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 Endpoints
17. 1717
» 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
Service 2 is down!
Service 2
18. 1818
» 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
19. 1919
» Client rewrites hostname portion
of URL with an actual service node
Implementing Service Discovery
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;
}
20. 2020
» Completely open source
» Part of the .NET Foundation
» Active user community
› Dedicated Slack channel
› Open Pivotal Tracker
» Examples and sample code in GitHub
Open and Engaged
21. 2121
» Using techniques to understand your portfolio of applications
» Get started sooner and in the correct place
» Use the tools (Steeltoe) to optimize applications to the cloud
Key Takeaways