DevPub
Free Mousepad

How Google Works

How Google WorksA look at the myths and facts about Google, and what you should know about Google's inner workings. Continue Reading

Search Engines and You: Getting Crawled

Search Engines and You: Getting CrawledHow to get your newly launched web site to be indexed by search engines and how directories can help you. Continue Reading

A Look at ASP.NET and Microsoft SQL Server

We are taking a look at the good and the bad of ASP.NET and Microsoft SQL Server web development combination in the context of a comparison to PHP and MySQL.

On Sunday, December 2nd 2007 at 03:21 AM
By Andrew Pociu (View Profile)
*****   (Rated 4.7 with 3 votes)

Released by Microsoft in early 21st century, ASP.NET replaced old ASP, which is now obsolete. However, saying that ASP.NET is an upgrade from ASP would be wrong, given the huge difference between the two. Nearly nothing is inherited from ASP, which was very well comparable to the PHP of that time. ASP.NET took a huge leap in using the .NET Framework as its basis, and languages such as C# and VB.NET to develop in. This means that when developing ASP.NET applications (just like any other .NET applications) you have the power to choose the language that you wish to use, from a large array starting with the very popular C# (similar in syntax to C++) and VB.NET (similar in syntax to Visual Basic) to less popular languages such as C++.NET and J#. If you're not familiar with the .NET Framework this may come as a surprise to you, however what you need to understand is that the languages differ between eachother mostly in syntax, but they all use the .NET Framework, which means that you could learn a new .NET language in a weekend once you are already familiar to the framework.

So far we've talked about how .NET is built, but let's have a look at the benefits of ASP.NET in combination with SQL Server. The first thing worth mentioning about ASP.NET is that the code you write is always separated from the markup. There is a possibility to write in-line code that embeds with the markup if you really want to, but I never encountered anyone doing this, since it goes against the object oriented nature of .NET. By having the code separated at all times, your markup is always clean and can easily be handed over by a web designer who has no knowledge of computer prgramming. Furthermore, there is built-in support for MasterPages (which would be similar to using the Smarty template engine in PHP), CustomControls (which would be like PHP plugins built as include files) and also a set of prebuilt controls that come with ASP.NET, such as a calendar, a log-in system and field validators. All these controls are very flexible and configurable to an incredible extent.

The code for your ASP.NET application gets compiled just like a .NET Windows Forms application does. What does this mean to you? Faster execution, increased security, great control over the copyright of your source code and smaller size. In laymans terms, by getting compiled, your code gets transformed into 0s and 1s, making the job of the server much easier because it doesn't have to interpret the code each and everytime, as PHP does (unless it's cached - and speaking of that, ASP.NET also has a great caching engine.) By having your website converted into 0s and 1s you won't need the source-code on the web server anymore, thus preventing anyone from having a peek at it in order to hack your website, stealing it or creating and distributing modified copies of it. If for example you are planning to build a CMS and sell it to thousands of customers, you don't have to sell your source-code, you can only sell the compiled website.

How does Microsoft SQL Server communicate with ASP.NET? Beautifully, since they're both coming from Microsoft, they were built for eachother and connecting the two is just as easy as connecting PHP to MySQL. Similarly to what ASP.NET does better than PHP, SQL Server does better than MySQL: performance, security and scalability. These benefits come mainly from the use of stored procedures, which is a feature of SQL Server that might come soon to MySQL as well. While MySQL performs well until you hit about a million rows in your database (which can be reached much more easily than you think.), SQL Server will perform very well with thousands of millions of rows, as long as your hardware can handle it.

Because of the licensing costs of SQL Server, many have opted for the ASP.NET & MySQL combination, which obviously has some downsides to it, but given the multitude of ASP.NET to MySQL connectors out there, the connection between the two is very well done, and it's definitely a good combination for those who want the power of ASP.NET but don't need the scalability of SQL Server.

Even if we only looked at the overall picture of ASP.NET and SQL Server, the conclusion to be drawn would still be the same: for large projects that require power, security and scalability, you can't go wrong with ASP.NET and SQL Server. Using tools such as Visual Studio Team Suite you can have a programming team working on the same website at the same time, efficiently and in a well organized fashion. If you are building Windows applications or services in .NET as well, you can easily integrate them with your website as well, thus a great feature for all corporate development out there.

Just like with everything else, there is a downside: even though .NET and ASP.NET itself is free and you can build websites without paying a dime, the licensing costs for the Windows Server operating system (ASP.NET typically runs on IIS) and eventually SQL Server is not a small one. Furthermore, even though the coder can do his coding in Notepad, no coder will want to do that, thus there is the cost of Visual Studio. On the other hand, there is Visual Studio Express, a stripped down version of Visual Studio that is free and almost just as great as Visual Studio. When it comes to costs, you should also note that if you're planning on hiring a .NET developer, you should know that they are more expensive than PHP developers (given the greater complexity of the language.)

Who uses ASP.NET and SQL Server? The best example is Microsoft.com which gets tens of thousands of visitors per second, as well as its other websites such as MSDN.com, the enourmous MSDN Library. Google.com uses an array of languages, one of which is C# (thus ASP.NET.) Although not a rule, whenever you see an URL with the ASPX extension, that's an ASP.NET website.


Rate Rate this article

Comment Comment on this article
Name: Email:
Message:

Comment Current Comments
by xcx on Sunday, February 3rd 2008 at 12:09 PM

xc

by khunmoe on Sunday, March 16th 2008 at 10:55 AM

You've done a great thing.... Thanks for that... I would like to know about that more and more and detail....if possible... thnks...