I am a member of freelance team AdvanceDev. There are a lot of customers asking us to develope a website or a crm using php. They tell lots of fake reasons why php is better than asp.net mvc and tell nonsence to prove their point of view.
In this article I would like to destroy most common myths about asp.net. By saying asp.net I mean asp.net mvc unless specified else. Old asp.net web-forms and asp.net mvc are two different technologies, it's like an apple and a pear, you cannot mix them up.
I am not trying to say that php is bad, my goal is to prove that asp.net mvc is not worse than php.
Okay, the most common "reasons" why customers do not want asp.net mvc in their projects
- Asp.net is outdated, but php is a tech of tomorrow
- There are lots of php developers, which may rescue your project if something goes wrong. In the same time there are too few asp.net developers.
- Website developed in asp.net requires an expensive server and won't work if published to a shared host.
- Asp.net websites work slower than php and getting even slower with large amount of users.
Asp.net is outdated, but php is a tech of tomorrow
This is a nonsense. PHP was developed back in 1994 and meant to be used in small websites. PHP - Personal Home Page, the name describes itself. Since that time php has grown up, a lot and the latest php 5.6 was released in Summer of 2014.
ASP.NET MVC was developed in 2007 and released to public use in 2009. Latest version asp.net mvc 5 was released in Summer of 2014.
In conclusion of these I may say that asp.net mvc is much newer technology, but both of them have great support by their teams.
There are lots of php developers, which may rescue your project if something goes wrong. In the same time there are too few asp.net developers
First of all we have to decide what means "developer". If asp.net and php show up in a picture then it would look like this:
It is obvious, that there are much more lumbermen which may use hacksaw that those which may operate gasoline-powered saw. If someone knows how to use the hacksaw that doesn't mean he may use gasoline-powered saw.
Basic knowledge of php is much more simple compare to asp.net, that is why everyone who knows php a little bit calling themself "php developer", but when it goes to the real big projects those "developers" fail terms and disappear.
There are many customers which ask us to "finish a php website, because their developer can't make such functionality" or "rework a php website, because it is very buggy and works very slow, but his creator got payment and disappeared". I could not remember any customer turning to us because of such problems with asp.net websites.
I think there are about the same number of good php and asp.net developers. It is very often when skilled developers may use both of the technologies.
Any developer, which has some big php and asp.net projects behind would tell you that php lacks a lot of useful features which make developer's life much more easy.
Website developed in asp.net requires an expensive server and won't work if published to a shared host
Another myth. Price for php and asp.net are about the same. Look here for an example: http://www.winhost.com/hosting-plans/max.aspx, for $7.95 a month you get everything you may need for an asp.net website.
You will need a dedicated server for big project and it does not matter which technology you use php or asp.net.
It is preferably to use Linux operating system for php websites, it is free, but if you need you may port a php website on Windows server very easily.
Windows is native and best operating system for asp.net, however asp.net may work under Linux with some limitations.
To use Windows you have to pay for the license.
Monthly about 25 euro:
Buy lifetime license:
- Windows 2008 R2 - from $250
- Windows 2012 R2 - from $500
As I mentioned before, php lacks lots of features which asp.net has, that is why developing the same site using php requires more time, means more money. From our experience I could tell that price for a project developed in php would be 1.5-2 times more expensive than the same project developed in asp.net.
ASP.NET MVC + Windows + MS-Sql Server
- Website development - $2000
- Operating system - $500
- MS-Sql Server - free edition
- Total $2500
PHP YII + Linux + MySql Server
- Website development - $3000
- Operating system - $0
- MySql Server - free edition
- Total $3000
As you may see the php variant is more expensive even if include Windows license price. If you are not satisfied with free edition of MS-Sql server, you always may choose MySql. MySql works great under windows and on pair with asp.net.
If you are considering not only money, but also development time and website speed then asp.net has even more advantages over php.
Asp.net websites work slower than php and getting even slower with large amount of users
It might be the biggest reason why customers are "afraid" of asp.net. Outdated asp.net web-forms is really slow, it consumes a lot of resources and it is very easy to mix everything up in the project. However asp.net mvc is not asp.net web-forms, you cannot mix them up! It is very common when php developers do not have any experience in asp.net and do now know what is asp.net mvc, but still claim that asp.net mvc is outdated and lose to php in every aspect.
I have made some real testing of php and asp.net performance, both php and asp.net were running at Linux and Windwos. A simple website was made for the benchmarks. The website is something like a small internet-shop, it contains set of products, set of customers, set of orders and set of order items. There are four testing scenarios.
In the all pictures:
- left side – time in seconds
- bottom side – number of users
I have shortened some names to minimize number of text in the diagrams.
- win – windows
- asp.net – asp.net mvc
- ms-sql – ms-sql server
- mysql – mysql server
1. Import from a text file
There is a text file which contains set of customers. The website reads data from the file, sort by alphabet, founds number of vowel letters in customer's name and displays the result to the user.
As you may see from the result asp.net under windows insignificantly loses to php under linux with small number of users and goes ahead with large amount of users.
Php under windows and asp.net under linux shows very bad results here.
2. Export into excel file from data base
The website needs to select all customers from the database, sort them alphabetically, save to excel document and return download link to the user.
In all cases asp.net mvc under windows + ms-sql server requires twice less time compare to php under linux + mysql.
Asp.net mvc + mysql shows almost the same result, asp.net under linux + mysql a little faster than php. Combination of php under windows and mysql again straggle behind.
3. Select and display products from database
Search for products by category and part of name. Display the result in an html table.
Asp.net again leads over php in any combination. I have to note, that mysql caches query result by default, that is why mysql is faster than ms-sql in this test. If manually enable caching for ms-sql we will get about the same results.
4. Place an order
Select a random customer. Create a new order. Pick ten random products. Save order data and display information about the customer and his order to the user.
In the latest test combination of asp.net mvc under windows + ms-sql shows significantly better result. Php under linux + mysql needs almost twice more time. Asp.net + mysql under windwos and linux also shows good results. Php under windows is far behind as alway.
Average performance by four tests
It is not difficult to notice that asp.net + ms-sql outperform php + mysql in any scenario, the more users, the greater the gap.
asp.net + mysql under windows shows almost the same result as php + mysql, but still a little faster,
asp.net + mysql under linux a little slower compare to windows,
and php under windows works very slow, I didn't even mention it in the final diagram.
All of the tests were performed on the same hardware. No other applications were running. Every test was performed four times and then took the average result.
- ASP.NET MVC 4, .NET 4.5
- PHP 5.6 YII2
- Windows 8, IIS8, MS-SQL Server 2012 Express, MySql 5.5
- Ubuntu 14.10, Apache2, MySql 5.5
- Ubuntu 14.10, Nginx + fastcgi-mono-server4, MySql 5.5
- CPU: AMD Phenom II 965 x4
- RAM: 4gb RAM
- HDD: WD 1T
And in conclusion I want to give some examples of successfully running asp.net mvc websites.
- http://stackoverflow.com/ - forum for developer and more. About a million users a day.
- http://dearsystems.com/inventory-software/ - a CRM for inventory management, very popular in USA and Australia.
- http://www.asp.net/ - website about asp.net.
- http://live.com/ - popular mail server and more.
- http://www.documentoved.ru/ - service for online document generation.
Here you may read some statistics about asp.net mvc
And here about php