Migrating Webforms to Microservices
by Eric Seng, on Aug 3, 2021 7:00:00 AM
.NET 6 is coming and if you were looking for a sign to migrate your monolith applications to microservices this is it.
ASP.NET web forms are going away and there is no word of official replacement from Microsoft. However, Microsoft does recommend IT organizations rewrite current ASP.NET web forms in Core Blazor or Razor. What that basically means is that a full rewrite is required if you’re interested in moving away from web forms.
The thing is, if you’re already doing a full rewrite, it actually makes much more sense to move away from monolithic applications and migrate to microservices using Blazor/Razor.
Monolith Vs Microservice – David Vs Goliath
ASP.NET Web Forms are generally released in a “traditional” software release where an application is released as a unified, single, usually humungous entity (thus the name monoliths.) There are benefits to this method, like development and deployment simplicity. However, maintenance and update are slow and difficult.
The opposite of your monolithic ASP.NET web forms are microservices and micro-applications built through Blazor/Razor.
Everyone knows the term “microservices” but are unlikely to define it the same way. Often, though, people mean “modularized development.” Modularized development, as the name suggests, is developing separate “modules” for discreet parts of your application or code. Just as your cell phone has totally separate applications for messaging and the camera, your IT systems can remain an integrated application while being modularized inside.
Sounds great, right? But as the saying goes, Rome wasn’t built in a day - and transitioning to microservices is not a trivial task; it will take time, effort, and resources. But with the right automation tools in place, microservices are just as easy to develop and deploy as monoliths but are much easier to maintain and update at speed.
.NET5 has an unprecedented release cadence for Microsoft. Each new .NET will come within just one year of the last major version and the long-term support period will be only three years. We all know how the story goes. David slayed Goliath and (in my opinion) microservices slay monoliths. To keep up with the pace that .NET5 and Microsoft are setting, you will need to be agile and responsive and that pace just isn’t possible if you’re working with a single, giant application.
While “traditional” Web Forms will remain available as long as .NET Framework is supported, it would be unwise to (re)write new applications to target this aging technology. Modularizing your applications to target .NET 5+ means you have smaller system pieces, which are simpler to update. Migrating to microservices is the best way to get the benefits .NET 5+ offers.
So What Should I Do?
Start planning your migration to microservices using Blazor and Razor.
Modularizing Web Forms applications for .NET 5+ will be complex but very worth the effort. Unlike Web Forms, whose code is entangled in the .NET Framework itself, MVC and Blazor work with .NET 5+, rather than as a core part of it.
The good news is, there’s no rush to do this today. You have time to properly plan this out and build your microservices while still utilizing and maintaining your monoliths.
How Hard Can It Be?
That’s a difficult question to answer. How difficult is cooking? All you need to do is chop some food and apply heat, right?
The biggest hurdle you and many other IT organizations will face in this migration is not necessarily the re-writing - but more the re-learning. You and your team are a well-oiled IT machine. Chances are you have a (combined) century’s worth of experience working with Web Forms at a much slower cadence.
Switching to Blazor or Razor requires your team to re-learn a whole new style of development pipeline.
The great news is with the right tool, much of this stress can be reduced through automation. BuildMaster pipelines let you build a repeatable release process by defining the servers and environments that your builds will be deployed to, as well as the manual and automatic approvals required at each stage of the process.
A basic web application might use a pipeline with only two stages (testing and production), and simply deploy to a different folder on the same server. Another application may require a dozen stages, each with multiple targets that go to different environments, and all sorts of automatic and human approvals to meet compliance requirements.
An added bonus of using BuildMaster is that it will also work with your current monoliths. What that means is that you get the best of both worlds. Your IT organization is able to keep your web forms for a bit longer while smoothly and efficiently transitioning to microservices.
.NET 6 is coming and the age of ASP.NET web forms is slowly coming to an end. This means that in one way or another your IT organization is going to have to make some changes.
Microsoft is moving towards a much more agile cadence. If you want to have any chance of keeping up in the long-term, migrating your monolithic Web Forms to microservices with Blazor and Razor is necessary.
With any big shift in technology there are growing pains. But using a build-automation tools like BuildMaster will seriously reduce those pains and allow your organization the comfort of the old while transitioning to the new.