As part of the series of posts announced at this initial blog post (.NET Application Architecture Guidance) that explores each of the architecture areas currently covered by our team, this current blog post focuses on “Web Applications with ASP.NET Core Architecture and Patterns guidance“.
Just as a reminder, the four introductory blog posts of this series are (or will be as of today) the following:
- Microservices and Docker containers: Architecture, Patterns and Development guidance
- Web Applications with ASP.NET Core Architecture and Patterns guidance
- Production Ready Cloud applications with Azure Architecture guidance
- Mobile Apps with Xamarin.Forms Architecture and Patterns guidance
The previous blog post focused on Microservices architecture. However, even when microservices are great for certain scenarios explained in that previous blog post, for most of the medium-size application scenarios, you still will want to create regular web applications, also named “monolithic applications” because of their deployment style. Microservices shouldn’t be the new “silver bullet” to be used for everything but just for certain cases. Therefore, in many cases, you still will want to create regular/monolithic web applications but using modern approaches and modern technologies.
Introducing the ‘Architecting Modern Web Applications with ASP.NET Core and Microsoft Azure’ Guide/eBook
Building web applications with ASP.NET Core, hosted in Microsoft Azure, offers numerous competitive advantages over traditional alternatives.
ASP.NET Core is optimized for modern web application development practices and cloud hosting scenarios.
In this guide, you will learn how to architect your ASP.NET Core applications to best take advantage of these capabilities.
Free download: http://aka.ms/WebAppEbook
.NET Core and ASP.NET Core offer multiple advantages over traditional .NET development. You should use .NET Core for your server applications if some or all of the following are important to your application’s success:
- Cross-platform support
- Use of microservices
- Use of Docker containers
- High performance and scalability requirements
- Side-by-side versioning of .NET versions by application on the same server
Traditional .NET applications can and do support some of these requirements, but ASP.NET Core and .NET Core have been optimized to offer improved support for the above scenarios.
More and more organizations are choosing to host their web applications in the cloud using services like Microsoft Azure. You should consider hosting your application in the cloud if the following are important to your application or organization:
- Reduced investment in data center costs (hardware, software, space, utilities, etc)
- Flexible pricing (pay based on usage, not for idle capacity)
- Extreme reliability
- Improved app mobility; easily change where and how your app is deployed
- Flexible capacity; scale up or down based on actual needs
Who should use this guide
We wrote this guide for developers and solution architects who are new to ASP.NET Core while looking to learn and adopt a specific web application architecture applying proven patterns and best practices.
You will also find this guide useful if you are a technical decision maker, such as an architect, who wants an architecture and technology overview before you decide on what approach to select for new and modern web applications.
Related sample ASP.NET Core web application: eShopOnWeb
The eShopOnWeb application (still in BETA state) is a sample reference web app based on ASP.NET Core. This application is open source and available at the eShopOnWeb GitHub repo.
The following diagram shows a high-level overview of the internal architecture of the sample ASP.NET Core web application:
The fact that a web application can have a monolithic deployment doesn’t mean that its internal design is also monolithic or “spaghetti code”.
Applications that follow the Dependency Inversion Principle as well as Domain-Driven Design (DDD) principles tend to arrive at a similar architecture. This architecture has gone by many names over the years. One of the first names was Hexagonal Architecture, followed by Ports-and-Adapters. More recently, it’s been cited as the Onion Architecture or Clean Architecture. It is this last name, Clean Architecture, that is used as the basis for describing the architecture in this eBook.
Clean architecture puts the business logic and application model at the center of the application.
Instead of having business logic depend on data access or other infrastructure concerns, this dependency is inverted: infrastructure and implementation details depend on the Application Core.
Here’s another view of an ASP.NET Core monolithic web application using multiple components related.
Visit the .NET Application Architecture Center and grab it all!
Remember that this ‘Web Applications with ASP.NET Core Architecture and Patterns guidance’ explained at this blog post is part of a broader .NET Architecture guidance which covers additional subjects and you can check out at the .NET Application Architecture Center page where you can download the multiple eBooks/Guides and visit the reference applications from there, and of course, feel free to provide feedback by dropping a note below or on the feedback form at the architecture page.
Happy coding from the .NET team!
Cesar de la Torre
.NET Product Group
Twitter: @cesardelatorre