| Members: 22 |
| Language: English |
|
Group categories:
|
| More group info » |
|
In this tutorial we?re going to talk about performance tuning yourColdfusion application. Some of the performance tips are compatiblewith Coldfusion MX 6.x, but most of the performance tips are Also we?ll talk about some database basics that are crucial for yourapplication performance. I always say, "Start at the source", and about90% of the bad application performance is due to bad designed databasesand/or queries. So we?re going to take a look at that as well. As wellas optimizing your database is crucial, the database choice is crucialas well. If the budget allows you to use MSSQL server,use MSSQL server! If you?re familiar with Access, it?s just a smallstep upgrading your skills to MSSQL server and trust me, it?s worth thelearning and practicing! Another point we?re going to look at is the new cftimer functionality that will make your life easier to test your application for any bottlenecks.
So let?s start at the bottom layer of the application, the database.First of all the choice of which database isn?t always there. If yourapplication has more then 5 concurrent users you shouldn?t use MSAccess. But if there is no alternative due to budget or something else,you must cache everything you can to optimize speed and bringing downthe database traffic. We?ll talk about caching later on in thisarticle. Database designStart at the bottom!Databases are most of the time the important part of your application.So try to build your database in a good way by using a lot ofreferential data. By referential data, I mean link database tables. Alittle example: You have 2 tables in your database, namelytbl_User and tbl_UserType. By using referential data, you sure that thedatabase cannot be corrupted due to malformed submitted data. Use thePrimary key of the tbl_UserType in the tbl_User to be sure that an"Administrator" user is not an "Admin" or "Adminstr". This way you cankeep your database tidy and clean. Some other thing you have to keep inmind is that the database needs to force the referential data. If youinsert a user with a non existing usertype, the data will not beinserted and returns an error. Take a look at the screenshot below howthis is done in MS Access. It?s the Dutch version of MSAccess, but the English or other language versions are the exact same.But enough about the database design. Let?s talk about optimizing yourcfquery?s. Optimizing your CFQUERY?sBecause noteveryone uses MSSQL Server, Stored Procedures are not for everyone. Butto make your normal cfquery?s that output the same data for a long timeyou can do the following. For instance, you have a comboboxthat contains all the countries from a database. This list almost neverchanges, but the query that gets the countries out of the database isrunned every time the page is displayed. So this query makes a perfectexample where to cache a cfquery tag. This can be done in 2 differentways, but we?re going to cache the query in this example for 1 hourafter it has been executed by a page request. Query example that is NOT cached cachedwithin="#CreateTimeSpan(0,1,0,0)#"> Query example that IS CACHED for 1 hour! You see the "cachedwithin" parameter. I used a CreateTimeSpan functionto specify the timeframe. It contains 4 numeric values, in the exampleit?s: 0,1,0,0. The first number is the amount of days, the second theamount of hours, third are minutes and the fourth are seconds. If youwant a timespan of 1 hour, you can also specify 60 minutes, this isjust a personal preference.READ MORE ..CLICK HERE~ ?
|
|
| Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy |
| ©2009 Google |