Enterprise-level web application architecture on Azure

Having been in software for 20+ years, the one thing that remains consistent is change. As soon as you think you have a technological stack working perfectly something new is released and disrupts it all! New technology often provides significant value so developers & architects are eager to utilize it, but it’s not always clear where “things go”.

I also understand very well that technology preferences are like the proverbial religious wars. Azure vs AWS, Angular vs React, Java vs C#, Linux vs Windows and so forth. And that’s OK. However this post is for people like myself, who feel comfortable with Microsoft’s .NET stack. The .NET Framework has been around since 2002 and that has allowed it to gain a lot of maturity. With .NET Core, Microsoft have applied the many lessons from .NET Framework to build a new & better platform. Read more about why enterprises are turning to .NET Core. I have no hesitation in recommending .NET Core for your enterprise-level web application.

I do also think it’s worth mentioning that Azure is purposefully not positioning themselves as Microsoft only providers. In fact, there’s a recent stat that shows how Linux now dominates Azure – who would’ve predicted this only a few years ago!?

So, at this moment time, I would use these components to build a brand new enterprise-level web application.

Infrastructure

Azure Web App on Azure App Service

Yes I know, what about containers? I love containers! Containers are great if you want to avoid maintaining an OS in the broad sense and you want to build for different OSes and providers. Docker has wonderful products and is fully supported in Azure with both Azure Kubernetes Services (AKS) and App Service.

However if you only require an application host and you know you’re going to stick with Windows OS and Azure, I would still recommend Azure Web App. It’s Infrastructure-as-a-Service, which makes it so simple. You can think of this as the same concept as a container, but it’s a little lower-level; so containerized IIS almost.

Azure Web Apps also provides everything you would need to run mission-critical web applications for the enterprise like scaling up and out, high availability, geo-replication and so forth across multiple slots (for dev, test & production environments for instance). It also has excellent insights (analysis) with almost zero setup. Not to mention real-time debugging with Visual Studio.

Server-side Framework

ASP.NET Core 2.2

Although the .NET Framework (currently at version 4.7.2) has been a very successful framework for a very long time, but for any new applications I would strongly recommend .NET Core (currently at version 2.2, although version 3 is in Preview at the time of writing).

.NET Core is a vastly refactored framework that is open-source (a fact often lost on many people), more compliant with better performance. It also has a great CLI for folks who prefer CLI and text-based editors over the powerful, yet bulky Visual Studio. I talk about IDEs and tools below.

To code the on the server-side you should use C#. VB.NET is not worth a long-term investment; despite Microsoft’s assurances I see this as a declining language. C# is a wonderful, continually evolving language that is as good if not better than any of the others.

Data Store

Almost all web applications require a data store. A common use case for web applications is dashboards, reporting or Business Intelligence (BI) from big(ger) data sets (often in Data Warehouses Blob Storage, Data Lakes etc.), but those data sets are mostly unrelated the web application itself and therefore falls outside the scope of this post. I might talk more about that in a future post.

Azure Cosmos DB

For web application data storage, I recommend Azure Cosmos DB especially if you’re comfortable with JSON and have an adequate understanding of document-based databases, also referred to as NoSQL. These databases are not relational like SQL Server or Oracle. But very often, especially for web applications, relational models don’t offer any extra value but add complexity and reduced performance.

Cosmos DB is enterprise ready with a great SLA.

Azure SQL Database

If you’re already comfortable with relational databases and don’t want to invest in learning NoSQL then you can’t go wrong with Azure SQL Database. It’s not exactly the same as SQL Server, but very similar. However it has significant enterprise-level benefits like scaling, availability, backups etc.

Be careful with security though. Microsoft’s suggested access pattern has it’s critics. Just ensure you’re compliant within your industry. Azure SQL Managed Instance (MI) might be a better choice if you require a more conventional VNET/Subnet security model.

JavaScript Framework

Angular 7+

For the client-side implementation of your web application, I confidently recommend Google’s Angular (also known as Angular.io or Angular 2+). Avoid AngularJS (also known as Angular 1); it’s a relatively easy framework to learn, but has some issues around performance and challenges with maintainability. With Angular’s tight integration with TypeScript it’s easier to maintain and safer to code with. It does take a little longer to set up, but it’s worth it.

React

Facebook’s React is also very popular and if you’re comfortable with it, use it. I’ve used both and I prefer Angular because of it’s tight integration with TypeScript as well as its clean patterns. React also has a TypeScript implementation, but it’s as well-supported as Babel, it’s own type engine. And I don’t see Babel as being as having the industry adoption that TypeScript has.

But they’re both excellent, well-supported frameworks. Vue.js is also getting a lot of attention nowadays, but it’s not one I’ve used. There has been so much written on choosing one so I won’t go into that again. I prefer Angular, but they all work fine with ASP.NET Core. Pick the one you want as indicated in the screenshot below.

Choose SPA Framework

Blazor (Web Assembly)

There is another experimental platform called Blazor that one should definitely be aware of for the future. It will build to a WebAssembly which is now supported by the mainstream browsers. This will mean you can code C# for the client-side! I think Blazor will be a major player in client-side development in the future. Very exciting indeed, but it’s too early at the time of this post.

CSS Framework

Bootstrap 4.1+

Bootstrap 4.1 is a very powerful and extensible CSS framework developed originally by Twitter, specifically with Responsive web design (RWD) in mind. Version 4.1 has some great improvements over the very popular version 3 and version 4.

Unfortunately version 4.1 still relies on jQuery and other 3rd party JavaScript libraries, but the intention is to rid the framework of these in version 5. So do look out for that.

With ASP.NET Core the client-side libraries have to be installed and updated with NPM packages. That’s a big topic on it’s own, so I won’t cover that in this post.

Real-time communication

SignalR

For real-time communication (chat, tickers etc.) use SignalR either in the application or better yet SignalR on Azure. It is a very specific use-case, but this is very cool technology that I’m very fond of.

Editors and other Tools

Code Editor

For folks who have been on the Microsoft stack for a while, Visual Studio is the go-to IDE. It’s a very powerful, rich & full-featured IDE that comes in 3 editions; Community, Professional & Enterprise. Community is free and fine for most cases. Visual Studio is now available on Mac, but it’s not open-source. The Enterprise edition is very expensive.

However unlike the old days, you don’t need Visual Studio to develop .NET applications any more. Because .NET Core was developed with a CLI, you can use any text-based editor to code for it. Notepad++, Sublime Text or, my favorite, Visual Studio Code all do the trick.

VS Code is also open-source and can run on all the OSes. It’s extensibility platform is quickly making it a developer favorite across tech stacks. It really is a great product. I’ll do a follow-up post on it at some point.

Data Access

If you’re using Azure SQL Database (or any other SQL Server-based data store) most people use SQL Server Management Studio (SSMS). It’s a very powerful, but bulky application that does all one needs. It’s free, but not open-source and only runs on Windows.

More recently Microsoft has released Azure Data Studio. I really like this tool. It’s a much lighter open-source multi-OS application that is also free. See if you can spot the trend here! 🙂

If you’re targeting Cosmos DB, you can use the Cosmos DB emulator for local development.

DevOps

Over the years, we’ve all seen these buzzwords. Web 2.0, Big Data, Machine Learning and so forth. It feels like DevOps is the trending buzzword currently! For those of us who have been using this for years (who remembers CruiseControl.NET?) it is encouraging.

I very strongly recommend DevOps and particularly the CI/CD part of it, but this is also a very big topic that I may post about in the future. For now though, look to Azure DevOps for all your needs.

Overview

Using these services, tools & frameworks you can develop web applications that can scale up and out to whatever you’re likely to need. With the knowledge that you’ll have the support of industry leaders like Microsoft, Google (or Facebook for React) and Twitter.

Happy coding!!

Blog at WordPress.com.

Up ↑