Writing Effective .Net / SQL Server Code

Let me preface by saying that I am not knocking .Net (this helps me make a living) ...

Recently I heard about the site, the developer / owner boasted that he had minimal hardware to support his site (manyoffish.com). This site is listed as the top 50 in terms of traffic on Alexa. I'm trying my best to bow my head to how something like this can be done by doing what the developer / owner claims, one developer writing the site (it took him 2 weeks to get the starting site) using the minimal equipment that gets 2 million hits per hour (peak). Big companies have huge web farms to handle traffic like this ...

How do you write such efficient code with limited hardware resources (it claims to use only three database servers)? Has anyone worked on or developed a website that is effective?

+4
source share
6 answers

The Microsoft stack is remarkably fast if you avoid all the drag and drop trash, which gives ASP.NET a bad name.

  • IIS is a good web server.
  • SQL Server is a good database.
  • C # compiles for quick code. (qualifications may be needed :)
  • ASP.NET can be quite lightweight if you use it correctly

This is the whole stack. Things are good. You can say what you like about Microsoft, its business practices and its consumer products, but their development tools and servers are top notch.

My personal experience with their web stack includes a site that sees ~ 500 page views / second and rarely hits a server above 15%. It is fast enough for most operations.

+6
source

This is more than just code: it requires a collaborative effort from developers, database administrators, and IT. Each team member must recognize the impact of their work on other areas of the team.

When a developer writes a query that scans a table in a heavy OLTP system, he needs to understand why it will not scale. When the database administrator sees a table scan, he needs to understand how to fix it at the database level or at the code level. When sysadmin sees heavy read activity on disks, he needs to understand the main reasons for this (such as scanning a table) in order to decide whether to fix this with the best code or throw more disks on it.

Effective systems are the result of the fact that each person does an excellent job, and communicates well with other team members. If only one of the team members is about to drop everyone under the bus, the system will not execute. And it looks like you are already doing this by throwing .NET and SQL Server under the bus .; -)

+4
source

With websites, some pretty interesting things can be done by caching. The language used is much less important if you can cache things efficiently.

+3
source

As jle said, caching is key. In addition, it may simply be the nature of the user interaction on the website. Maybe I'm wrong, but I think the example, a multi-user site, is not a particularly resource-intensive and resource-intensive site. Apparently, there is a lot of data in user profiles, but (in my limited verification experience) the purpose of the site is not to manipulate or correlate or transform the data, but simply to return profiles that match the user’s criteria - but not really mass the data in any way.

+3
source

Compared to alternatives, .Net is really quite effective. What else is there? Php? Java? Ruby? Of course, you could code your web application in C ++, but this will be a big problem for implementation and support. In addition, as others have noted, with proper caching, database tuning and algorithms, you can get very good performance. A way of greater productivity than just choosing a quick langauge and writing code that is not configured.

+2
source

It is difficult to answer the specifics, but not all options that are made in software development are created equal, even using the same language. The more layer on the framework layer you stumble upon something, the further you get away from “what is really important”, and if “what is really important” is productivity, a person who can program at this “lower level” can do a lot , many times faster than people who develop programs by combining controls. Sometimes simplicity of development is more important than speed of raw materials, therefore it is not always the right choice at the lowest level - simplicity of code maintenance is also important and sometimes outweighs raw performance.

Once I went to the head with another consultant trying to win a high contract of 6 pieces for a large financial services firm, we both sold the idea of ​​a BI / EIS system. He used inflated technologies and every step of the way, but all this was a “new and brilliant” technology, on which he was very proud and contained all the right keywords.

I wrote mine in asp (asp classic, .net wasn’t yet) and uses custom written SQL Server native methods of communication with all manual encoded procedures to generate reports and other similar productivity solutions. He used a plug-in for recording reports and plug-and-play controls to create his system. I did my entire demo on switch 28.8 against my development web server in my home office 200 miles away - it was done against a much more powerful development server in the next room, connected via a 100 megabyte ethernet, and there was still a lot. many times slower.

When the demonstration ended, I told my clients that my entire demonstration was done over the telephone line (they assumed it was local). This sealed the deal, as most users of the system were scattered across the country, and broadband was unusual at the time.

+2
source

All Articles