Resources on Improving Scalability of ASP.NET apps

Resources on Improving Scalability of ASP.NET apps

I plan to compile all the good stuff I find on Scaling ASP.NET applications here for easy reference. If you know of any other useful resources, please leave a comment

1) The freely downloadable Patterns & Practices guide Improving .NET Application Performance and Scalability has exhaustive info and is a kind of .NET bible. The guide is still relevant eventhough it has not been updated since it was first published in 2004.

2) Key points from the MSDN magazine article "Scaling Strategies for ASP.NET Applications":
  • Specialize- break your application into smaller pieces in order to isolate the problem. Know where your slowest bits are
  • Optimize the code before throwing more hardware at it. Test to measure improvements
  • Implement load balancing - add servers, duplicate the application across them
  • Eliminate affinity for effective distribution
  • Minimize Payload by 1) turning on compression 2) reducing ViewState 3) using AJAX (discriminately) to make initial render times faster and reduce perceived size of the payload by spreading it out over time
  • Implement caching - ASP.NET supports three forms of caching: page caching (also known as output caching), partial-page caching, and programmatic (also known as data) caching.
  • Partition databases into readers and writers. The reader databases are read-only; they receive their data from the writer databases via replication. All data queries go to the reader databases, which are optimized for reading data as fast as possible. All data write requests are sent to the writer databases, which are partitioned and tuned to write efficiently.
3) Jeff Atwood offers some food for thought on scaling -
Scaling up and scaling out are both viable solutions, depending on what problem you're trying to solve, and what resources (financial, software, and otherwise) you have at hand.

...scaling out is only frictionless when you use open source software. Otherwise, you're in a bit of a conundrum: scaling up means paying less for licenses and a lot more for hardware, while scaling out means paying less for the hardware, and a whole lot more for licenses.

Also see:
Approaching ASP.NET Application Performance and Scalability Improvement
SQL Server Performance Audit Checklist
Read More
Fiction to Fact

Fiction to Fact

Just like Jules Verne's ideas on submarine in the book Twenty Thousand Leagues Under the Sea have turned out to be prophetic, the idea of a gestural interface in the movie Minority Report seems to have inspired many researchers and such a UX technology could be commonplace in the near future.

Scott Hanselman recently interviewed Johnny Chung Lee, a researcher in the Applied Sciences group at Microsoft who works with the Project Natal team. Project Natal is the code name for a hands-free motion-sensing technology by Microsoft for the Xbox 360 video game platform.

Science is hardly a topic on Indian prime time TV, but last Sunday the channel CNN IBN started a series called Superstars of Science which featured among other innovators, Pranav Mistry, who is working on a wearable gestural interface at MIT Media Lab.
Read More

Online Reputation/Recommendation systems

It is interesting to see how the Web is increasingly being used to help as a reputation/recommendation system.

Online recommendation

On the work front, there is a good chance that LinkedIn.com can give you some background about a person you are about to meet for the first time. For many, the ratings & recommendations for books on Amazon.com help in deciding on making a purchase. StackOverFlow.com is a unique forum for software developers that not just has answers but also ratings for those answers through "crowdsourcing".

I hope the infrastructure/frameworks for building such reputation/recommendation systems become more easily available & configurable so that developers can build more meaningful websites.

Dear Reader, what websites do you frequently look up for recommendations or validating information?

Related:
Preparing your online profile for employers
If You Liked This, You’re Sure to Love That
Read More

Book Review: In the Trenches with Microsoft Office Project 2007

In the Trenches with Microsoft Office Project 2007Project 2007 is a complex & powerful tool for Project management. By taking over the number crunching & analysis part, it helps Project Managers conserve time and focus on decision making aspects. In the Trenches with Microsoft Office Project 2007 by Elaine Marmel shows how to use Project 2007 for various Project management situations in about 350 odd pages. In a part cookbook, part tutorial style the author takes the reader through common scenarios that a PM can face, suggests best practices and offers useful tips.

As the author admits, this book is not specifically a guide for Project 2007. It is ill-suited for beginners to Project 2007. It does not target any specific edition of Project 2007. I feel the contents could have been organized and presented in a better way to make it more engaging. I love it when key points are summarized at the end of each chapter (as in Code Complete or some of the Microsoft Certification guides). That way, the gist of the chapters are sticky & more memorable. I sorely missed it in this book.

If I had to rate this book in Amazon style, I would give it 3 stars out of 5

Trivia - Project 2007 does not have the "Ribbon"

Also see -
HOW TO create a Ribbon-less Excel 2003 UI in Excel 2007
Read More
HOW TO keep up-to-date on the latest technologies & trends

HOW TO keep up-to-date on the latest technologies & trends

Microsoft Solution Architect MVP Udi Dahan's view on managing the avalance of technical info on the new technologies that is available these days -
"Never has so much information been so readily available and accessible to so many. It turns out, though, that much of that information is about how something works, less about what problem it is intended to solve, and much less about which problems it isn’t suited for. As an architect looking at choosing the right tool for the right job, I focus a lot more on the last two. Often, I go digging to find out why a tool isn’t a good fit for a job. So, I guess my recipe is to mostly ignore the avalanche and tap my network to find out the stuff the avalanche won’t tell you."


From The Architecture Journal
Read More
What is "domain sharding"

What is "domain sharding"

It's a term that Steve Souders uses to describe intentionally splitting web page resources across multiple domains to make pages load faster.

Steve Souders has done extensive research on improving front-end performance of website. He has shared his findings on "domain sharding":
  • Most of the U.S. top ten web sites do domain sharding.
  • The optimal number of domains to shard across is 2-4. After 4 domains, response time degrades
  • Domain sharding is especially useful for older browsers as they are restricted to just two parallel downloads per hostname. The newer browsers however do better. Opera 9+ and Safari 3+ do four downloads per hostname. Internet Explorer 8, Firefox 3, and Chrome 1+ do six downloads per hostname.
Also see:
HOW TO improve the front-end performance of a website
HOW TO speed up a ASP.NET AJAX web app
Read More
Free ASP.NET based CMS

Free ASP.NET based CMS

A Content Management System allows content creators to submit content without requiring technical knowledge of HTML or the uploading of files. The following is list of free ASP.NET based Content Management Systems -

Free, with source:
Related:
Open Source .NET projects
Read More
HOW TO fetch unread emails from a mail server

HOW TO fetch unread emails from a mail server

I learnt today that fetching unread email messages is not natively supported by POP3.
The POP3 protocol does not provide the ability to ask the server which emails are "unread". Furthermore, a pure POP3 server does not even keep this information. Some servers, such as Exchange Server, expose both POP3 and IMAP interfaces. In these cases, information about read/unread status exists on the server, but it is only available via the IMAP protocol.

There is a code sample on getting the list of unread messages from an IMAP server using a commerical component Rebex Mail for .NET. Although I haven't tried, I guess this can be achieved using IMAP components like these -
IPWorks! IMAP Component from /n software
Rebex Mail for .NET
Chilkat IMAP .NET
EAGetMail IMAP4 Component
Lumisoft (free)
xemail-net (free)
InterIMAP (free)

So what's the difference between IMAP and POP? An answer from the Gmail FAQ -
Unlike POP, IMAP offers two-way communication between your web Gmail and your email client(s). This means when you log in to Gmail using a web browser, actions you perform on email clients and mobile devices (ex: putting mail in a 'work' folder) will instantly and automatically appear in Gmail (ex: it will already have a 'work' label on that email the next time you sign in).

IMAP also provides a better method to access your mail from multiple devices. If you check your email at work, on your mobile phone, and again at home, IMAP ensures that new mail is accessible from any device at any given time.

Finally, IMAP offers a more stable experience overall. Whereas POP is prone to losing messages or downloading the same messages multiple times, IMAP avoids this through two-way syncing capabilities between your mail clients and your web Gmail.

If you're trying to decide between using POP and using IMAP with Gmail, we recommend IMAP.

Also see:
HOW TO avoid Spam Filters while emailing programmatically
HOW TO view only the unread messages in your Gmail inbox
So, you want to be a Gmail ninja?
Read More

Humor is dying. Preserve MAD

There is news that after 55 years as a monthly publication, MAD magazine will become a quarterly.

It is, of course, a sign of the times, if ever their were one, a sign that the magazine is continuing to struggle at the hands of newer forms of media, seven years after finally caving and including advertisements in its printed form. It’s also a sign, Jaffee adds, half jokingly, that “humor is dying.”

Reviewing Mad’s 500th issue which has a spoof on Google, Wired magazine has this to say about MAD -
Now well into its emerald anniversary, the spoof-filled magazine founded by William Gaines in 1952 has left an immeasurable stamp on global entertainment. Mad served as a comedy Bible to Monty Python auteur Terry Gilliam, taught Roger Ebert how to write film reviews and peddled parody to the masses. According to Patti Smith, it more or less replaced drugs altogether.

It is a consolation that there is a DVD compilation of over 600 issues of Mad Magazines from 1952 to 2006 - Absolutely MAD Magazine - 50+ Years available for around 30 bucks. I bought my copy a few months ago and being a amateur cartoonist I'm thrilled going through the artwork & creativity of my favorite artists, David Berg and Al Jaffee over the years.

MAD DVD

Related:
Al Jaffee's Mad Fold-Ins in Flash
Read More

Free C++ Learning Resources

Many school and college students start their programming careers learning C++ as part of their curriculum. Here is a list of free e-books and compilers:

C++: A Beginner's Guide by Herb SchildtMicrosoft's Beginner Developer Learning Center has some fantastic introductory learning material for Web and Windows Development. As part of that, C++: A Beginner's Guide by Herb Schildt, a step-by-step book ideal for first-time programmers or those new to C++, is available in electronic format for downloading.

Bruce Eckel's two volumes of Thinking in C++ can be downloaded from the author's website.

When I was in college, Turbo C++ was the compiler/IDE we used. It is pretty light and available now in Antique Software section of Embarcadero Developer Network. Turbo C++ was originally built by Borland. It is currently distributed by Embarcadero Technologies, which has acquired all of Borland's compiler tools.

You can also use Microsoft's Visual C++ Express Edition for free

Related:
Dreamspark in India
Read More
Can SQL Server Express be used on a Production Server?

Can SQL Server Express be used on a Production Server?

Yes...with some limitations, going by these threads on the ASP.NET Forums.

The FAQ for the Express products has another interesting point about SQL Server Express

What is the difference between SQL Server 2008 Express and SQL Server Compact Edition?
SQL Server Compact Edition is a lightweight , easy to deploy database system that is ideal for Windows database development. A 2MB footprint that requires no administration makes it an ideal solution for creating most data storage needs. Some of the limitations of SQL Server Compact Edition:

* Does not accept remote connections
* It is not compatible with the design time tools for LINQ to SQL
* Does not support stored procedures

SQL Server Express is designed to be feature-rich and powerful database system. It is an ideal solution for creating client-server Windows applications and Web development. Some of the features of SQL Server Express:

* Develop stored procedures with Visual Basic Express and Visual C# Express
* Full support of design time tools like LINQ to SQL
* A huge data storage of 4GB capacity

SQL Server Express is designed to meet the needs of simple applications. It is limited to using 1 CPU and up to 1GB RAM, with a 4GB maximum database size.

Trivia - Did you know, while the estimated retail pricing for U.S. and Canadian editions of SQL Server 2005 is $24,999, the Developer Edition which includes all the functionality of Enterprise Edition is $49

Related:
Can VS 2008 editions be installed side-by-side?
Read More

Need a Progress Indicator image-get a customized Throbber

The animated image that you see in most AJAX based websites to indicate progress is called a Throbber. If you ever need a Throbber, you can turn to the free and excellent Throbber Generator by Yannick Croissant (A.K.A Country). You can choose from a variety of indicators and also change the background and foreground color of the Throbber.

Trivia - I was able to know Yannick Croissant's site is in French from the awesome auto-detect language feature on Microsoft Translator and Google Translate.

Related:
Make a Progress Indicator For Slow-Loading Pages
Build a Dynamic Progress Page For ASP.NET Pages
Read More
Why are these Visual Studio Settings not enabled by default?

Why are these Visual Studio Settings not enabled by default?

Enclosing HTML attribute values within quotes is one of the steps to make your web pages XHTML compliant. The benefit of making your web pages XHTML compliant is that there is a high probability that your pages would become cross-browser too. ScottGu pointed out a tip from the Visual Web Developer MSDN blog (Tip#66) about a Visual Studio 2008 setting that can automatically enclose property values in the HTML editor within quotes while you are typing.
To set this option select Tools->Options. Check Show all settings. From the left pane select Text Editor -> HTML -> Format and check the insert attribute value quotes when typing checkbox.

This is no doubt a cool tip but as an aggrieved reader of that blog post mentioned, why is this nifty, time-saving option not enabled by default?

Similarly, don't we wish any HTML code that we pasted into VS is automatically formatted? Tip #59 -
In Tools->Options dialog, go to Text Editor->HTML->Miscellaneous page. Check ‘Format HTML on paste’ option.

Also, don't we want the Solution Explorer to always show the file currently opened in the Editor highlighted especially when there are a lot of files in the solution?
On the Tools - Options - Projects and Solutions - General page, there's the Track Active Item in Solution Explorer. When enabled, this will sync your solution explorer with the open document.

These small settings can make a big difference for most developers and I wish these were enabled by default.

On a related note, if you are looking for more tips on the VS.NET IDE, check Sara Ford's Visual Studio 2008 Tips and those on the Visual Web Developer MSDN blog. My favorite in the later are:
Tip #23: Did you know…How to launch Formatting options dialog for editor with 2 clicks?
Tip #24: Did you know…You could display CSS/HTML errors as warnings or as errors?
Tip #28 - Did you know… That “Go to definition” is supported for CSS Class?

Also see:
HOW TO achieve XHTML compliance by changing existing HTML code in upper case to lower
VS.NET 2005 keyboard shortcuts
Read More
HOW TO pronounce foreign names

HOW TO pronounce foreign names

When I was in school & being a non-native English speaker, it was a revelation to me that "Nietzche" is pronounced "n ih t sz ah" and "Sean" as "sh aw n".

I was glad to find the website "Pronounce Names" which calls itself a "Dictionary of Name Pronunciation". I tried out several intriguing names and found the service useful.

Especially when you are doing business, mis-pronouncing a client's name will not be overlooked as a trivial slip-up.

In today's international business environment, it is exceedingly important to say your clients name correctly, you CANNOT afford to call Dumass, a Dumb-ass

You can not just look-up pronunciation of a name on the website but also submit pronunciation of a name so that others can pronounce it correctly and request pronunciation of a name that you don't know and would like to find out.

I hope as the website gets more popular & their database increases, they will come up with an API so that other websites can programmatically access this invaluable repository.

Also see:
WordWeb - the desktop English teacher
Phone number to word - mnemonic generator
Read More
HOW TO build your own Project Template in Visual Studio 2008

HOW TO build your own Project Template in Visual Studio 2008

If you build a lot of websites that follow a similar structure or wish to enforce a similar structure within your team so that the code and applications are consistent and standardized, you can consider building your own Project template in Visual Studio 2008 in order to re-use. For instance, you may want the jQuery libary to be included in a JS folder for every new website that you create. Just like you see "ASP.NET Web Site" & other templates when you choose File > New option, you can have a custom Project Template show up after you create a new Project template.

The Visual Web Developer MSDN blog has detailed step by step instructions on creating a custom Project template for Visual Studio Web Developer & VSTS. I adapted the steps described there to create a Project template for VS 2008. Here are the instructions paraphrased for VS 2008:
  1. Open the model website based on which you wish to create newer websites.
  2. From the File menu, select Export Template...
  3. In the Export Template Wizard that appears, choose Project Template and click the Next button
  4. Choose a template name and specify a description for it.
  5. Keep the checkboxes "Automatically import the template into Visual Studio" and "Display an Explorer window on the output files folder" checked. (If you want your template to appear for all users, you should first un-check Automatically import the template into Visual Studio) and click on the Finish button of the Wizard.
  6. Copy the template (.zip file) alongside the other Project templates in this folder - Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\Web\CSharp\1033
  7. Select Visual Studio 2008 Command Prompt from Visual Studio Tools that appears in the Programs menu under Microsoft Visual Studio 2008.
  8. Run Devenv /setup at the command prompt
Now when you start creating a new website, you can select your new custom template.

Similarly, you can create an Item Template so that whenever you select File > New > File... or right click on a project within Solution Explorer & choose "Add New Item...", you can find a custom Item template similar to Web Form or AJAX Web Form.
Read More