Optimize ASP.NET Membership Stored Procedures for greater speed and scalability

21 05 2009
Here is a good article from Omar AL Zabir. If you are also using ASP.NET Membership/Role/Profile providers, or at least checking if you can use it as i do, it has pretty good and practical results. Thanks Omar for this informative and beneficial article.

Last year at Pageflakes, when we were getting millions of hits per day, we were having query timeout due to lock timeout and Transaction Deadlock errors. These locks were produced from aspnet_Users and aspnet_Membership tables. Since both of these tables are very high read (almost every request causes a read on these tables) and high write (every anonymous visit creates a row on aspnet_Users), there were just way too many locks created on these tables per second. SQL Counters showed thousands of locks per second being created. Moreover, we had queries that would select thousands of rows from these tables frequently and thus produced more locks for longer period, forcing other queries to timeout and thus throw errors on the website.

If you have read my last blog post, you know why such locks happen. Basically every table when it grows up to hold millions of records and becomes popular goes through this trouble. It’s just a part of scalability problem that is common to database. But we rarely take prevention about it in our early design.

Read the rest of this entry »





Closures

12 03 2009

This is a good article from Martin Fowler.

As there is a growing interest in dynamic languages, more people are running into a programming concept called Closures or Blocks. People from a C/C++/Java/C# language background don’t have closures and as a result aren’t sure what they are. Here’s a brief explanation, those who have done a decent amount of programming in languages that have them won’t find this interesting.

Closures have been around for a long time. I ran into them properly for the first time in Smalltalk where they’re called Blocks. Lisp uses them heavily. They’re also present in the Ruby scripting language – and are a major reason why many rubyists like using Ruby for scripting.

Read the rest of this entry »





The difference between ASP.NET Web Site and ASP.NET Web Application

11 03 2009

I have just read this at stackoverflow.com.

Website:

The Web Site project is compiled on the fly. You end up with a lot more DLL files, which can be a pain. It also gives problems when you have pages or controls in one directory that need to reference pages and controls in another directory since the other directory may not be compiled into code yet. Another problem can be in publishing.

If VS isn’t told to re-use the same names constantly, it will come up with new names for the dll files generated by pages all the time. That can lead to having several close copies of dlls containing the same class name, which will generate plenty of errors. The Web Site project was introduced with VS 2005, but has turned out not to be extremely popular.

Web Application:

The Web Application Project was created as an add-in and now exists as part of SP 1 for VS 2005. The main differences are the Web Application Project was designed to work similar to the Web projects that shipped with VS.net and VS 2003. It will compile the application into a single dll at build time. In order to update the project it must be recompiled and the dll published for changes to occur.

Another nice feature of the Web Application project is it’s much easer to exclude files from the project view. In the Web Site project, each file that you exclude is renamed with an exclude keyword in the filename. In the Web Application Project, the project just keeps track of which files to include/exclude from the project view without renaming them, making things much tider.

Reference: http://www.megasolutions.net/AspNet/difference-between-Web-Site-and-Web-Application-Project-27210.aspx

This article also gives reasons on why to use one and not the other. Here is an excerpt of it:

  • You need to migrate large Visual Studio .NET 2003 applications to VS 2005? use the Web Application project.
  • You want to open and edit any directory as a Web project without creating a project file? use Web Site project.
  • You need to add pre-build and post-build steps during compilation? use Web Application project.
  • You need to build a Web application using multiple Web projects? use Web Application project.
  • You want to generate one assembly for each page? use Web Site project.
  • You prefer dynamic compilation and working on pages without building entire site on each page view? use Web Site project.
  • You prefer single-page code model to code-behind model? use Web Site project.




10 Insanely Useful Django Tips

13 02 2009

One of the reasons i add posts in this blog is to open it in the future and read my posts. I can say this is a kind of bookmarking for me. This post will be a bookmark to revisit in the future.

Here is the next article i have read in nettuts.com and think really useful. I read many things about Django and it seems really cool. Although I couldn’t create a full application with it yet, i am sure it will be really nice to use Django.

This article is from Glen Stansberry who is a web developer and blogger. You can read more tips on web development at his blog Web Jackalope or follow him on Twitter.

There are quite a few great little tricks and tips one could use on their Django projects that would speed up development and save many headaches in the long run. From basic to obscure, these tips can help any skill-level of programmer become more adept with Django and all it’s glory.

Read the rest of this entry »





Is the Relational Database Doomed?

13 02 2009

I read an interesting article in ReadWriteWeb.com which i follow daily. It is a good idea to take a look at the article. I paste first part of the article here.

Recently, a lot of new non-relational databases have cropped up both inside and outside the cloud. One key message this sends is, “if you want vast, on-demand scalability, you need a non-relational database”.

If that is true, then is this a sign that the once mighty relational database finally has a chink in its armor? Is this a sign that relational databases have had their day and will decline over time? In this post, we’ll look at the current trend of moving away from relational databases in certain situations and what this means for the future of the relational database.
Read the rest of this entry »





10 Ways to Improve Your Programming Productivity

11 02 2009

The following is a quote from Matthew Moore. He has an interesting post on his blog Adventures in Starting-Up

Having worked at Google and now working in my own business, I’ve noticed that some days I’m just a rockstar at getting everything done, and others I can barely get a few lines of code out, or accomplish anything on my todo list.  Of course, now that I’m in a really small business, every single day counts, for each person in the business.

After looking back and trying to figure out what separates one day from the next, here are some commonalities I’ve noticed.  All of these are obvious with a little bit of thought, and I’m certainly not the first one to come up with these ideas.  But a reminder of them can go a long way. Also, some of these only apply when you’re in Marathon mode (like when you’re trying to be effective over the course of a year or two), and not in Sprint mode (like when you have a major, major deadline in 2 weeks).

Read the rest of this entry »





The PHP Benchmark

11 02 2009

I found PHPBench.com when i was stumbling. It is a simple but good site that lists some performance issues with basic php functions and usage of them.

PHPBench.com was constructed as a way to open people’s eyes to the fact that not every PHP code snippet will run at the same speed. You may be surprised at the results that this page generates, but that is ok. This page was also created so that you would be able to find discovery in these statistics and then maybe re-run these tests in your own server environment to play around with this idea yourself, by using the code examples (these code examples are automatically generated and as the code in my .php files change, so do they).

You should take a look to see basic differences of using those functions and what you are doing right / wrong.





Ten of the Biggest Mistakes Developers Make With Databases

10 02 2009

Although fashions come and go in software development, some things stay remarkably constant. One of these is the use of databases. You may be wonderfully up-to-date with an AJAX Web interface or the latest whizbang Windows user interface, but under the covers, you’re probably still pumping data in and out of a database, just as we all did a decade or more ago. That makes it all the more surprising that developers are still making the same database mistakes that date back to those good old days of Windows 95 and before. Perhaps it’s just that most of us learn to use databases on the side, rather than really studying them. In any case, here are my nominations for the biggestmistakes that I see over and over again.

Choosing the Wrong Database
Not all databases are created equal — which means before you do anything with a database, you have to pick the appropriate database. Time and again I’ve seen Access databases groaning to bear the load of huge data sets that would have been child’s play for SQL Server, or harried users trying to pay for and set up SQL Server to hold a few hundred rows of data. Broadly speaking, there are three tiers of databases in the market these days: desktop and embedded databases suitable for smaller tasks, “Express” versions of the major players that are good up to a few gigabytes of data, and the truly enterprise databases like SQL Server, Oracle, and DB2 that can handle just about anything you can throw at them. Before you do anything else, you need to make some realistic estimates about the amount of data that you’ll be storing and pick the appropriate product to do the storage. Read the rest of this entry »





5 useful url rewriting examples using .htaccess

8 02 2009

If you are looking for the examples of URL rewriting
then this post might be useful for you.

Now let’s look at the examples:

1)Rewriting product.php?id=12 to product-12.html

It is a simple redirection in which .php extension
is hidden from the browser’s address bar and dynamic url (containing
“?” character) is converted into a static URL.

RewriteEngine on

RewriteRule ^product-([0-9]+)\.html$ product.php?id=$1

Read the rest of this entry »





Intro to Django – Building a To-Do List

7 02 2009

Django is a powerful web framework, created in Python, which follows
the DRY (Don’t repeat yourself), and batteries included philosophies.
It allows for rapid website development by providing a wide range of
tools and shortcuts out of the box. Django is extremely fast and
flexible – even faster than all of the PHP frameworks available. In
this article, I’ll introduce you to Django by showing you how to build
a simple to-do list.

To read full article by Logan Mortimer visit nettuts.com

Technorati Tags: , , ,