.NET Tutorial: Modernize Existing .NET Applications

DZone 's Guide to

.NET Tutorial: Modernize Existing .NET Applications

Is cloud-native right for your .NET application?

· Web Dev Zone ·
Free Resource


Is cloud-native right for your .NET application?

Together, with the Cloud movement and its functions and benefits, Software practices and trends have been converging towards creating or migrating the applications towards a Cloud-Native compliant architecture. This may include:

  • Microservices, where you have independently deployable applications with their isolated data persistent layers, which are not shared along with other services.
  • Polyglot architecture, where you are not tied to a homogenous stack with a single programming language. You can also use the data persistency option, rather using different language stacks for different purposes and also benefiting from several different types of Database and Datastore options.
  • Containers, where you define all your application dependencies, thus guaranteeing the portability all the way from developer workstation to production.
  • Serverless, where you split your application into functions and deploy those functions to a Cloud-managed cluster where you do not notice any underlying server and middleware maintenance and can define several options to trigger those services.

Moving towards a cloud-native compliant architecture

Moving towards a cloud-native compliant architecture

Furthermore, to all those evolving trends, the .NET Programming language is also adapting itself to those changes in the software industry. One of the major changes is cross-platform support.

.NET can also be built and run on Linux kernel-based operating systems, which brings cost-saving and also the option to run .NET on Kubernetes.

Besides, as .NET is open source, this affected the support from the community in a positive way. Together, with its lightweight architecture, which brings higher performance compared to the previous .NET versions, .NET Core is now the defacto version of .NET for all new projects. Migration efforts towards this version from the existing legacy applications have begun in mass.

Considering the progress and the trends both in software in general and also in .NET in particular, kloia is providing a multi-dimensional model for the .NET modernization. There are three main dimensions in this model:

  1. .NET Core Transition: The compatibility of the existing application or the newly developed application on .NETCore
  2. Splitting the Monolith: Identifying the existing bounded-contexts and splitting those contexts into microservices where each context is an independently deployable code including its Database.
  3. Cloud-Native:  Exploiting the advantages of cloud computing delivery model including DevOps practices using the cloud resources managed resources like PaaS or serverless, considering a decoupled polyglot architecture model, and using Kubernetes as an orchestration platform.

There are three steps that can be illustrated as:

  1. Assess your current codebase and dependencies, create a report and roadmap
  2. The transition may have different paths based on the output of the initial step which makes an analysis of possible scenarios and also time cost-complexity of this is estimated. These are the possible scenarios:
    • 2.a. Refactoring towards .NET Core
    • 2.b. Redevelopment from scratch on .NET Core
    • 2.c Modernizing with:
      • 2.c.i. Mono-Project: Building and Running existing .NET applications on Linux with Mono, which is officially supported by Microsoft.
      • 2.c.ii. Blazor: Build legacy .NET Windows UI applications, to be run inside a browser, thus modernizing the release cycle and cross-platform support, which is officially supported by Microsoft.
  3. Acceptance of the final state of the application.

This model covers various .NET application versions and types. Here is a basic chart of the coverage and possible paths:

.NET Transition Paths
NET Transition Paths 

Note: Dotted lines mean that this path will be evaluated during the assessment phase and the thicker the line, the higher the complexity.

This path deals with the transition of an existing Monolith application. For that purpose, the assessment is done from the bounded-context and Domain-driven perspective, rather than .Net Core compatibility. Thus, this path is .NET Core agnostic.

There are four steps in that model:

  1. Replatforming the current stack to a Cloud-Native state with micro-refactoring wherever needed. One example can be AWS Elastic Beanstalk. This step aims to get rid of current manual operations on infrastructure and deployments, thus increasing the focus of the team for the next phase.

  2. Assessment of the current code-base with the following activities:

    • Dependency Analysis (Libraries, domains, …)
    • Database Relation Map
    • Domain / Bounded-Contexts Analysis

    The output of this step is a Value-Risk graph where we define the distinct functions and their position in the graph

    Value Risk Graph
  3. Pre-splitting tasks are crucial before the actual “major-refactoring” begins, the following pre-requirements should be done for the purpose of managing the unexpected incidents during the journey:

    • Test Automation: Before the splitting begins, there should be enough regression test coverage which will run before each refactoring deployed to production.
    • Monitoring: Creating full visibility of the current stack including:
      • Metrics on all levels.
      • Log Management.
  4. Refactoring for splitting the bounded-contexts in the order which is agreed with the customer.

The functions, resources, and services provided by the cloud providers have been increasing and diversifying. It is very likely that you will find an equivalent service that you normally would develop yourself. Benefiting from those Cloud functions, in other words, the Cloud Native approach saves time and money.

Some of the Cloud functions that are introduced for those modernization projects are:

  • Serverless.
  • Managed Resources (PaaS)Databases, Key-value Stores, Message Queues, EKS.
  • ETL, Import/Export AWS Glue, Athena, EMR.
  • Object StorageS3.
  • TriggersVarious triggers after a specific event(i.e. File upload ).

Cost Saving: Various options together with Serverless, managed resources, auto-scaling(Even scaling to 0!), Windows OS License

Performance: Moving away from IIS means getting away from various overheads together with .NET Core’s lightweight and lean architecture which boosts performance

Cloud-Native: Cloud functions which make your development and deployment cycles less complex and manageable

Cross-Platform: Possibility to run your workload both Windows and Linux and even on Kubernetes!

  • DotNetCore Transition
  • Cloud-Native
  • Containerization and Serverless
  • Splitting the Monolith

Good luck with your journey!

Related Articles

cloud ,containers ,devops ,docker ,dotnet ,kubernetes ,microservices ,serverless ,software ,web dev

Published at DZone with permission of Dorian Sezen . See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}