Why companies should build web products on ASP.NET Core

Today, companies around the world have recognized the power and extensibility provided by REST APIs and thus more and more of them are building their products around APIs. So, today I will chiefly be focusing on APIs while justifying why ASP.NET Core is best solution for building them. However, I must say that this framework also excels at rendering views with “Razor view engine” as it’s view renderer.

What are the Selling points of ASP.NET Core ?
  •  It’s based on C# and thus inherits following language features:
    • Firmly grounded in OOPs
    • Supports asynchronous operations
    • Supports threading on multiple cores
  • ASP.NET Core is free and open source, no-licensing required.
  • It is cross – platform, can run on linux
  • It comes with it’s own webserver called “Kestrel” which can be reverse proxied with production ready web-servers like Nginx.
  • It comes with robust ORM called “Entity Framework Core” that supports all major databases, like MySQL, PosgresSQL, Oracle etc
  • It is much faster than any other framework that promises long term maintainability.
  • Your team can apply language skills to multiple platforms after working on ASP.NET Core, like mobile or desktop development.

Why OOPs is important ?

In one line, I would say – “Long Term Maintainability”.

As developers we work in teams of every size, which work together but on different parts at a time. When working in teams following is desirable:
• We should be able to consume components created by others and vice-versa.
• Someone should be able to manage my code ,if say, I switch the company.

It’s not impossible but substantially hard to achieve those objectives with a language that don’t adheres to OOPs. And when I say that, I rule out Node.js and PHP as Object Oriented languages. They are “Object Capable Language”.

As for PHP it always had backward compatibility issues. They are infamous for making breaking changes. And for Node.js, even with transpilers it lacks essential features like interfaces, abstract classes etc.

When you work with OOPs based language you necessarily impose a kind of contract in the components that you create. And those who consume your components have to obey that contract. That really cut-down half of the unwanted surprises that comes with non-object oriented language, while consuming services written by you team mate. And luckily, C# is based on OOPs.

Why async is important ?

ASP.NET core supports async operations. That is, it don’t block processing thread while waiting for a slow I/O operation to complete (like DB transactions). Rather, it releases that thread to accept other incoming requests. This model substantially improves API performance. Node.js also has async features while PHP completely lacks asynchronicity. That means PHP won’t scale well when your server face many thousands of requests per second. As for Node.js, though it supports async operation it’s a single threaded language. That is, you cannot perform multi-core operations on it, i.e you cannot scale vertically with it.

ASP.NET Core is free !

ASP.NET Core is completely open source and is a re-write of .net framework. This means you can utilize it in commercial projects without any licensing overhead.
Not only that, it’s cross platform also. That means it can be hosted on linux as well. Yeah, guessed it right, you don’t have to pay for windows OS to host ASP.NET Core, it will work on Ubuntu as well.

It comes with a lite-weight webserver called Kestrel which in turn can be reverse proxied by mature and production ready webservers like IIS, Nginx etc.

ASP.NET Core is fast – even faster than Node.js

Node.js can serve 1000 requests per sec. Fast, right ?.
Dot Net core can serve 20,000 requests per second. What do you think now ? Here’s that article by Raygun who performed this benchmarking test. Raygun has now shifted to .net core and and have reported 2000% increase in throughput since.

Increase in throughput directly translates to lower hosting cost. Thinks it like this, with ASP.NET Core you can reduce your VMs by 20 times, when compared to node.js and this is a big gain, your hosting costs would come down by 20 times with ASP.NET Core.

Goodies that comes with ASP.NET Core

Along with ASP.NET Core you get compatibility with Microsoft backed ORM called "Entity Framework Core" which supports LINQ and is a very mature ORM.

For identity management you get Identity Framework Core and for real time communication you get "SignalR Core", which is based on websocket, but a lot more manageable and with fallback support.

So it's a full packed solution.

ASP.NET Core is an enterprise solution

When you go out to build any product - long term support and backward compatibility are very important. Microsoft, is well known for that. It believes in making organic growth and very rarely bring any breaking changes during support cycle of it’s products. When compared to PHP and Node.js based Express, ASP.NET Core is far more stable, easy to maintain and much better in terms of backward compatibility.

Plus, ASP NET Core scales well - both horizontally and vertically. Vertical scaling might be of huge interest to algorithmically rich application.

Promotes cross-domain talent usage

While working on ASP.NET Core, your teams get to learn C# and OOPs in general. With C# you get transferable skills which can be applied to cross-platform mobile development with Xamarin, desktop development with WPF or UWP or if you are feeling fancy then you can also try ML.NET for training machine learning models and of course Unity should not be left out for game development.

Summary

I am not anti PHP or Node.js they both are great languages. In fact, this website is powered by wordpress, which again is a PHP product. But I will again emphasize that RESTful APIs and long term maintainability were my primary concerns and I don't see any other framework standing anywhere near ASP.NET Core.

Each language has it's own strength. I like using Node.js for quick prototyping or for building really simple applications. Similarly, I find PHP to be very strong community wise. It has ample of CMS, E-Commerce build around it. But, when security, simplicity and scalability are your concerns then look no further than ASP.NET Core.