Modernizing .NET applications on Google Cloud safer and faster

Oct 3, 2024 | Digital Transformation Modernizing .NET applications on Google Cloud safer and faster

Modernizing legacy applications, particularly those built on .NET frameworks, entails a comprehensive shift from traditional, monolithic architectures hosted on on-premises infrastructure to more agile, scalable cloud-based models. The migration and modernization of these applications address the challenges often faced with on-prem deployments such as the management of on-premises servers, restricted deployment options, and difficulties in upgrading due to their monolithic nature.

In contrast, cloud-based architectures offer many advantages. These include reduced management overhead through the utilization of managed services, enhanced mobility facilitated by technologies like containerization, and scalability without the burden of Windows dependencies or licensing costs. Cloud environments also enable an agile upgrade path by adopting independently deployable microservices and provide the agility to scale resources dynamically through serverless architectures.

Ultimately, the journey of modernization requires careful planning and strategic utilization of available resources. It involves a step-by-step approach, starting with pre-modernization assessments to understand the current state of applications. From there, organizations can gradually migrate applications to the cloud, either as-is or with minimal modifications to the application code or configuration. The modernization path on Google Cloud describes the journey in three stages:

  1. Rehost in the cloud (also known as lift and shift)
  2. Re-platform
  3. Re-architect and re-build

In this article, we will focus on how CAST technology can facilitate and accelerate the transition to Google Cloud Platform (GCP). We'll examine how insights from CAST Highlight and CAST Imaging can optimize the migration and modernization process, ensuring efficiency at each stage of the journey. Modernizing .NET applications on Google Cloud Platform (GCP) offers numerous advantages for customers, enhancing their operational efficiency, scalability, and overall performance. Here's a breakdown of the key benefits:

  1. Modernizing .NET applications can offer significant licensing advantages for customers, primarily by reducing or eliminating the need for expensive Microsoft licenses, like Windows Server licenses, as .NET Core applications can run on Linux servers, which are typically more cost-effective
  2. Enhanced Scalability and Flexibility: GCP provides a highly scalable infrastructure that can effortlessly handle increasing workloads. Customers can easily scale their .NET applications up or down based on demand, ensuring optimal performance and cost efficiency.
  3. Cost Optimization: By modernizing .NET applications on GCP, customers can significantly reduce infrastructure costs. GCP offers a pay-as-you-go pricing model, allowing customers to pay only for the resources they consume. Additionally, GCP's managed services, such as Cloud SQL and Cloud Memorystore, eliminate the need for costly hardware and software maintenance, further reducing operational expenses.
  4. Innovation and Modernization: GCP offers a wide array of cutting-edge technologies and services that can be seamlessly integrated with modernized .NET applications. These include machine learning APIs, big data analytics tools, and serverless computing platforms, empowering customers to innovate and stay ahead of the competition.

Lastly, accelerate the modernization journey with CAST: By leveraging CAST in conjunction with Google Cloud, customers can gain instant insights into the existing structures of their .NET applications, speeding up the various steps of the modernization process and ensuring a safer journey. Modernizing these applications can feel like brain surgery—just as a surgeon relies on an MRI scan to understand precisely what’s inside before operating, you need to know the intricacies of your applications. This is where CAST's technology plays a crucial role as part of the Google Cloud Application Modernization Program, used by Google Cloud experts, customers, and system integrators to plan, accelerate, and de-risk migrations and application modernization initiatives. In fact, since 2022, CAST has been working alongside Google to automate the migration and modernization of custom applications for hundreds of clients worldwide, addressing a large variety of old and new languages such as C#, C++, VB.NET, Java, JavaScript, Python, Cobol and more, and various application types among Windows, mainframes, monoliths, databases and others.

Modernization with CAST Solutions

First, let's introduce the two core products from CAST designed to empower organizations throughout their modernization journey:

CAST Highlight

Serving as a comprehensive software portfolio analysis software, CAST Highlight offers organizations a holistic perspective on their software portfolios. This solution automatically provides insights and recommendations about the applications’ cloud maturity, health, green impact, as well as intellectual property and security exposures associated with third-party components.

CAST Imaging

CAST Imaging automatically understands how an application works. It takes all application source artifacts and reverse-engineers the internal structures into a visual representation of software internal architecture. This solution assists organizations in comprehending and analyzing codebases by highlighting key elements, including components, dependencies, and data flows. The visualization capabilities of CAST Imaging facilitate informed decision-making, pinpoint areas for improvement, and optimize software assets for enhanced efficiency.

Phase 1: Rehost in the cloud

During this initial phase, the primary goal is to transfer server management responsibilities from on-site resources to the Google cloud infrastructure. Rehosting on GCP provides access to a wide range of cloud-native services, such as managed databases, machine learning APIs, and serverless computing platforms. These services can be easily integrated with .NET applications, enabling new functionalities, improving performance, and accelerating innovation.The focus is in preparing the infrastructure for the cloud to facilitate optimization in subsequent phases. CAST plays a pivotal role in enabling optimization during these subsequent phases. Research indicates that the advantages of a straightforward lift and shift approach can diminish 1 to 1.5 years after migration. CAST Highlight's insights mitigate this risk by fostering a proactive optimization approach. By offering visibility into potential blockers hindering the utilization of cloud-native services, CAST Highlight empowers us to address these hurdles early in the journey. This proactive approach enables us to capitalize on cloud-native services sooner, before the benefits of the lift and shift approach fade.

CAST Highlight contributes to this stage through two key steps:

Step 1: Application Segmentation

CAST Highlight conducts an analysis that automatically categorizes a portfolio of applications into different segments, aligned with the Gartner 5Rs framework. This segmentation quickly identifies applications suitable for rehosting and determines optimal starting points. Moreover, it identifies applications primed for immediate utilization of cloud-native services. For instance, applications recommended for refactoring may require only minor modifications to be containerized or to leverage cloud-native services.

Figure 1. Application segmentation based on factual source code analysis with CAST Highlight. This segmentation aids in determining which applications are best suited for Rehosting and which are already well-positioned to capitalize on cloud-native features.

Step 2: Identifying Blockers

CAST Highlight delves deeper into potential blockers within these applications. This is particularly vital for applications earmarked for rehosting first. By gaining insights into the effort required for optimization, we can proactively plan for the subsequent phase, which involves optimizing and leveraging cloud-native services wherever feasible. This insight aids in resource planning to ensure a smooth transition toward more cloud-native solutions, a process known as re-platforming, which we will delve into further in the next phase.

In summary, while the initial benefits of rehosting an application are significant, there are additional advantages to be gained through cloud optimization. CAST Highlight offers automated insights into an application's cloud-native barriers, allowing us to tackle them proactively and accelerate our adoption of cloud-native solutions.

Phase 2: Re-platform

Phase 2 of application modernization entails re-platforming, which involves upgrading components like databases, caching layers, or storage systems to leverage cloud features for enhanced management, resilience, scalability, elasticity, and AI capabilities. Re-platforming your .NET applications on GCP, after the initial rehosting phase offers several significant advantages that can further enhance this modernization journey. A common re-platform approach involves transitioning from VMs to containers, and this is where CAST plays a vital role. Cloud blockers, identified in Phase 1, are elements within the application that could slow down the transition to containers and must be carefully examined and resolved to ensure a seamless migration. CAST Highlight is instrumental in automatically identifying these blockers.

Figure 2. Cloud containerization blockers for a specific application, detected automatically with CAST Highlight.

CAST Highlight provides the rationale for each containerization blocker categorized in three types of impact:

Blockers impacting containers: As an example, legacy use of Windows registry for application settings necessitates converting registry entries into a .reg file and incorporating them into the container via Dockerfile. Other container configuration blockers, such as reliance on temporary local files and non-web configuration files are also detected.

Blockers impacting application code: Issues such as accessing environment variables require setting up variables in the container. CAST Highlight aids in identifying affected files and estimating effort for remediation.

Blockers impacting application architecture: Use of Webform Authentication necessitates transitioning to Cloud Identity integrated authentication for cloud applications. CAST Highlight helps identify code files with dependencies on Webform Authentication. Other architecture blockers such as file manipulation and middleware usage are also detected.

In summary, CAST can play a significant role in the re-platform phase as we begin to move VMs to containers. The insights around containerization blockers from CAST provide visibility into the elements that need to be addressed and associated effort to optimize and transition the application to a more cloud native platform. This can ensure a smooth transition to leveraging solutions like Compute Engine or Google Kubernetes Engine (GKE).

Phase 3: Re-architect and re-build

Re-platforming in phase 2 is a significant step toward benefiting from the cloud. However, in order to take full advantage of cloud services, we may need to make more significant architectural changes to our applications. Re-architecting and rebuilding .NET applications on GCP represents the most transformative stage of modernization, unlocking a host of powerful advantages that can revolutionize the application landscape - By re-architecting .NET applications on GCP, we can be future-proof against technological obsolescence. Cloud-native architectures are inherently more adaptable and can be easily updated or modified to incorporate new technologies or features as they become available.

One advantage of architectural transformation is cost optimization. As an example, containerization on a Linux container will provide cost benefits as we avoid paying Windows licenses. However, in order to get there, we need to remove elements of the application that are not compatible with Linux. Typically, in a .NET workload, this entails removing any dependencies on the legacy .NET Framework. While this modernization activity is common among many organizations today, particularly with the trend towards open source, performing these tasks manually can be challenging and time-consuming, often involving a complex and detailed analysis of the application. This is where CAST Imaging proves invaluable. Unlike manual methods, CAST Imaging automatically generates interactive blueprints that illustrate the internal structure of the application. Its mechanisms for exploring and visualizing the end-to-end flow of applications are crucial for accelerating the understanding and modernization process. Furthermore, CAST Imaging assists by identifying incompatible objects, aiding efficient refactoring.

Figure 3. An overview of application objects with .NET incompatibilities, and the analysis of an object showing the affected source code plus the related objects for further investigation, as seen in CAST Imaging.

The transition to .NET 6+ often coincides with UI modernization as well. Legacy UI components tied to the legacy .NET Framework, often built on ASP.NET/MVC, require refactoring into a modern UI platform. CAST Imaging expedites this transformation by offering insights into front-end components, their interactions within the application, and comprehensive UI architecture. These insights support precise implementation plans and serve as a knowledge repository during refactoring.

Figure 4. Visualization of the UI elements and their dependencies within the application in CAST Imaging. Each object, and relevant source code, can be further explored to understand the various objects involved in an end-to-end flow.

Another opportunity to optimize costs is found within the application's data layer. Many organizations are contemplating a shift from legacy SQL Server databases to modern open-source alternatives like PostgreSQL. This transition yields savings by removing Windows and/or proprietary database licensing expenses.

During a database migration, identifying artifacts and their dependencies is crucial. These include tables, indexes, procedures, and triggers. Traditionally, understanding application dependencies on the data layer and pinpointing areas requiring testing post-migration is a labor-intensive and error-prone process. Evaluating interdependencies, especially for tables needing alterations, is essential but challenging when done manually. This is where CAST Imaging offers a significant advantage. Unlike manual methods, CAST Imaging automates the identification of artifacts and their dependencies, enabling database administrators to ensure the new database mirrors the original accurately. This automation not only streamlines the migration process but also enhances accuracy and efficiency, ensuring a successful and smooth transition.

Figure 5. Visualization of the interaction between elements of the application with a specific table (Users).

While analyzing various SQL schemas, it's typical to find elements incompatible with the target platform, like PostgreSQL. These elements require refactoring and substitution with compatible equivalents. By leveraging CAST Imaging for system analysis, inconsistencies are detected within both the code and the database, aiding in highlighting these discrepancies.

Figure 6. An illustration of Datetime function usage, detected by CAST Imaging, which is incompatible in PostgreSQL.

Lastly, further optimization may mean leveraging managed services, or taking advantage of continuous integration tools and automation to improve development productivity and software quality. Often, in order to take full advantage of these capabilities, a transition to a more modular design of the application is needed. Microservices, as an example, can be a key aspect of modernization and involves breaking down legacy monolithic applications into smaller, more manageable, and loosely coupled services. This approach is instrumental in enabling continuous delivery and deployment of large and intricate applications.

A common approach is to modernize applications over time, especially those that are monolithic in nature. However, executing this effectively requires a deep understanding of the application, which can be challenging and time-consuming when done manually. This is where CAST Imaging proves invaluable. Unlike manual methods, CAST Imaging expedites the discovery and understanding of the application by automatically generating visual representations of all its components, including web interfaces, databases, and their dependencies.

Figure 7. Full map of the application describing the relationships and dependencies of the various components and databases, reverse-engineered by CAST Imaging.

Defining boundaries among interconnected components poses a challenge, often requiring the identification of component clusters suitable for "extraction" into microservices. Imaging facilitates this process by visualizing transactions from both top-down and bottom-up perspectives. The transaction view exposes all elements of an end-to-end data flow tied to a specific business rule or function. This automated visualization enables the team to identify loosely related transactions, pinpointing initial candidates for migration to microservices in line with the coherent boundaries principle of domain-driven design. This approach significantly reduces the effort and risk associated with manual methods, ensuring a smoother and more efficient modernization journey.

Figure 8. End-to-end transaction and data access graph visualization. The transaction view (left) displays top-down data flow while the data access graph view (right) shows a bottom-up data flow.

Once candidates are identified, having precise knowledge of their objects and attributes is crucial for estimating the effort required for the new microservice. Attributes including the number of objects, dependencies with other modules, size, and complexity (cyclomatic complexity) are essential factors in understanding the workload involved in implementing such a service.

Once a new microservice has been developed and thoroughly tested, it can be deployed on a modernized GCP service, thus progressing the journey of transitioning from a monolithic application to a microservices-based architecture.

In conclusion, re-architecting and rebuilding your .NET applications on GCP is a strategic investment that can yield significant benefits in terms of cost savings, innovation, performance, reliability, and developer productivity. By embracing cloud-native principles and technologies, you can transform your legacy applications into modern, agile, and scalable solutions that can drive your business forward.

Conclusion

The modernization journey on GCP presents both opportunities and challenges. GCP offers strategies to overcome these challenges and ensure a seamless transition. Additionally, CAST technology generates detailed insights into software portfolios and application architectures, expediting migration and modernization at every step of the journey.

Partnering with CAST and GCP empowers organizations to confidently embark on this modernization journey, equipped with the necessary solutions and expertise to thrive in the cloud-native environment. By combining the strategies provided by GCP, and the CAST solutions, organizations can unlock their applications' full potential in the cloud.

Looking to get started?