Free articles
Google
Web www.media13.com


Media13.com is a source of free to republish or reprint articles, writers may submit your articles in our database as long so you agree that your article will be freely republish or reprint by other.


Submit Article

Search our database

Received article from us.

Name

Email Address

Friends

Bollywood News
Link building
Article submission service
Freelance Writers
Laser hair removal

We have been looking for freelance writers. Contact us

 


ASP, CGI and PHP Scripts and Record-Locking: What Every Webmaster Needs To Know   by Sunil Tanna



Many of us install server-side (ASP, CGI or PHP) scripts on our
web sites, and many of this scripts store data on the server.
However, poorly designed scripts can experience performance
problems and sometimes even data corruption on busy (and not so
busy) web sites.

If you`re not a programmer, why should this matter to you?

Answer: Even if you`re just installing and using server-side
scripts, you`ll want to make sure that the scripts that you
choose don`t randomly break or corrupt your data.

First, some examples of the types of scripts which store data on
web servers include:

(Of course, many scripts in each of these (and other) categories
are well-designed, and run perfectly well even on very busy web
sites).

1. Follow-up autoresponders typically store the list of
subscribers to the autoresponder, as well where in the sequence
of messages, each subscriber is. Examples of autoresponder
scripts: http://www.scriptcavern.com/scr_email_auto.php

2. Classified ad scripts store (at least) a list of all the
classified ads placed by visitors. Examples of this type of
script: http://www.scriptcavern.com/scr_classified.php

3. Free for all links scripts store a list of all links posted by
visitors. See some example scripts listed at:
http://www.scriptcavern.com/scr_ffa.php

4. Top site scripts usually store a list of the members of the
top site as well as information about the number of `votes` that
each has received. For examples of this type of script, see
http://www.scriptcavern.com/scr_topsite.php

So what kind of scripts have problems? And what sort of problems
am I talking about?

Well the principle problems all relate to what happens when bits
of data from multiple users needs to be stored on updated at the
same time. Some scripts handle these situations well, but others
don`t...

DATA CORRUPTION

Here`s a common data corruption problem that can occur with many
scripts:

1. When some bit of data needs to be updated, a copy of the
server-side script starts running, and then starts updating it.

2. If another user comes along and does an update before the
first copy of the script has finished, a second copy of the
script starts running at the same time.

3. There are a number of ways things can now go wrong, for
example:

(a) What if the first copy of the script reads in the data, then
the second copy reads the same data, then the first copy updates
the data, then the second copy updates the data? Answer: any
changes made by the first copy of the script can get lost.

(b) What if the first and second copy of scripts are both adding
multiple bits of new data to the store at the same time? For
example, imagine each needs to store the headline, description
and the name of the person posting a classified ad. Well, what
can happen (with some scripts) is the two classified ads can get
intermingled, so you might get (for example) HEADLINE-1,
DESCRIPTION-1, HEADLINE-2, PERSON-1, DESCRIPTION-2, PERSON-2.
Or worse yet, you might get bits of each part of each classified
ad, mixed with the bits of the other. This type of thing is
usually really bad news, as your data may consequently becoming
unusable from that point on.

Does this sound too unlikely a problem to worry about? Don`t bank
on it... even if it happens only 1 time in 1,000, or 1 in 10,000,
eventually it will happen: You need a solution.

So the real question is: is it possible for programmers to create
scripts without these kinds of problems? Fortunately the answer
is yes, and there are a number of ways that programmers can
address it:

1. They can store each bit of data in a separate file. This isn`t
necessarily a total solution by itself (in particular, a script
which just does this could still have problems if multiple copies
of a script update the same file at the same time), but it does
make data corruption less likely, and if corruption does occur,
at least it won`t corrupt the entire data store in one go.

2. They can use file-locking. This means that if one copy of a
script is working with a file, another copy of the script is
prevented from working on that file, until the first copy has
finished. File-locking works if done correctly, but programming
it into a script needs to be done very carefully and precisely,
for every single possible case... even a tiny bug or omission can
allow the possibility of data-corruption in through the backdoor!

3. They can use a database (such as MySQL) to store the data.
Provided the data is properly structured in the database, the
database handles the locking automatically. And, as the
programmer doesn`t have to write their own special locking
routines, the possibility of bugs and omissions are much reduced.

PERFORMANCE PROBLEMS

Of course, avoiding having your data corrupted should be the
paramount consideration in choosing a script, but is there
anything else we need to be concerned about?

Answer: Performance

Of course, all webmasters are aiming to build busy high traffic
web sites... but will your scripts be able to handle the load?

Go back and re-read the paragraph on file-locking. Now think about
what would happen if all the classified ads on your classified page
were stored in a single file (or all the links on your top site, or
all the subscribers to your autoresponder, etc.).

What would happen?

Answer: Because each update can only be performed after the previous
update has been completely finished, your site may be slow, or even
unable to handle all your users` requests.

So what`s the solution?

There`s two options that programmers can use:

1. They can use lots of small files and file-lock each
individually (for example, one per classified, one per top site
listing, etc.). Of course, this needs to be handled very
carefully...

2. They can use a database (like MySQL), as databases allow any
one individual record (`row`) to be updated, even when another
is also being updated.

IN CONCLUSION

Now, let`s summarise:

1. Scripts that store data in files need to use file-locking
to avoid data-corruption, and they also need to break the data
into separately updateable chunks to avoid performance problems
on busy web sites.

2. Scripts that store data in databases (like MySQL), provided
of course that they have been properly coded, are usually less
likely to suffer from data-corruption or performance problems.

And one additional point:

3. Even the best script is not immune to hard-disk hardware
failures, your web host being struck by lightning, and all the
other snafus that can happen. So, do take regular back-ups of any
data that you can`t afford to lose!

In short, even if you`re not a script programmer, you need to be
aware of data storage issues. In future, when considering a
script for your web site, don`t be afraid to ask some hard
questions about how it stores data and how well it handles multiple
users.

This article is Copyright (C) 2005, Answers 2000 Limited.

About the Author:
This article was written by Sunil Tanna of Answers 2000. For a
directory of ASP, CGI, PHP and Remotely hosted scripts, please
visit http://www.scriptcavern.com - and for scripts written by
Answers 2000 please visit http://www.scriptrocket.com
-----------------------------------------------------------------
-----------------------------------------------------------------

Publication Terms And Conditions:

Answers 2000 Limited grants you a free non-exclusive permission
(license) to publish a copy of this article on your web site or
opt-in ezine, subject to you complying with ALL of the following:

1. You must publish the article in full and unedited (except that
you may omit this Terms and Conditions section, you may omit the
word count, and you may correct any typos that you might find).
2. If you publish on a web site: (i) you must make ALL links
clickable, (ii) you may format the article to fit within your web
site`s design, (iii) you must include the copyright notice and
`About the Author` section at the end.
3. If you publish in an ezine: (i) your ezine must be opt-in with
your users having specifically elected to subscribe to your ezine
and with the ability to unsubscribe at any time, (ii) you must
include all link URLs unedited and in full, (iii) you may format
the article to your ezine`s layout, (iv) you must include the
copyright notice and `About the Author` section at the end.
4. To the maximum extent permissible under law, this article is
provided `AS IS` without warranties of any kind whether express
or implied.
5. These terms and conditions shall be governed by and construed
in accordance with the laws of England and Wales. Any disputes
arising from matters relating to this article shall be
exclusively subject to the jurisdiction of the courts of England
and Wales. You agree that any legal action against Answers 2000
Limited (or its directors, officers, or employees) relating to
this article or this agreement will be brought in the courts of
London, England, however Answers 2000 Limited reserves right to
pursue breach of these terms in any jurisdiction.

There are 1225 words in this article (including title and About
the Author section).

-----------------------------------------------------------------

Author Info:

This article was written by Sunil Tanna of Answers 2000. For a
directory of ASP, CGI, PHP and Remotely hosted scripts, please
visit http://www.scriptcavern.com - and for scripts written by
Answers 2000 please visit http://www.scriptrocket.com


Latest 20 articles

IRS Offer in Compromise – Can It Solve Your IRS Tax Debt Problems? Taking on IRS tax debt is a daunting task that presents many confusing issues. The majority of taxpayers are aware of the option to pay their IRS tax debt in full or pay the tax debt in monthly payments or installments. But there is another option, the IRS “Offer in Compromise.” Knowing the steps to success with an IRS Offer in Compromise, also commonly called IRS tax settlement is important, bec

IRS Tax Debt Settlement Help – When You Need Expert Tax Debt Help With the recent downturn in the economy, Americans find themselves not only facing unsecured credit card debt problems, and difficulties handling their home and vehicle loans, but oftentimes unable to pay their IRS taxes in a timely manner. There is IRS tax debt help available to anyone who finds they owe money for back income taxes to the Internal Revenue Service. The federal government offers

Hidden Dog Fence for your dog Almost everyone who has a pet at home knows value of added exercise and the troublesome task of confining him within the boundaries of their own property. This task is especially difficult with dogs as they take it as a personal challenge to try and defy the fence boundaries. However, you can train your dog to respect his boundaries with the help of an invisible, underground wired dog fence /

Top Dog Containment Solution to make you Worry Free Is your dog driving you crazy? Are you sick of listening to your neighbors’ complaints about your dog running around in their yard? Then you are not alone; almost every pet owner suffers with this problem. Often they confine their dogs to the house due to fears that their dog may wander away. This is a valid fear, as dogs, especially the ones who are new to the house or have not been trained prope

Outdoor Services in Virginia A front lawn is the face of a house and no matter how beautifully you have decorated your house, if your lawn is not beautiful then all your efforts will be useless. It is very important to take care of your lawn because, as it is said, “the first impression is the last impression”. For most people, lawn care is a very tedious task. Most people don’t have the time or energy to spend hours in th

Hidden Dog Fence – Perfect Dog Containment Solution Does your dog refuse to listen to you? Are you tired of telling your dog to not go outside the confines of your house? Does chaining or locking up your dog makes you feel guilty? Is your dog ruining the interior of your house because you cannot let him go in the yard because you are afraid to let him out? Then stop worrying! The perfect solution for all these problems is here. There is a pet co

Debt Settlement: Your Bankruptcy Alternative? There are several different paths you can travel to achieve effective credit card debt reduction and pursue living a debt free life. The method which will be covered here is called debt settlement, and there are numerous debt settlement services to choose from if you determine this is the “debt recovery path” you are going to take. Credit card debt settlement is a credit card debt reduction solu

Los Angeles Brain Injury Lawyers Assist California Motorcycle Accidents Victims Last year over 6,686,147 motorcycles were registered within the United States and the number of registrants has been steadily increasing by at least 7% each year since 2003 according to the NHTSA. Consequently the NHTSA also reported that nation wide last year there were 103,000 motorcycle injuries that did not result in a fatality and California has the second highest motorcycle fatality rate in

Christian Debt Relief: What Are Your Options? Unfortunately, with the downturn in the U.S. economy, credit card debt problems have become one of the biggest challenges facing Christians and their families as they strive to have a healthy financial future. Credit card debt is crippling not just Christians, but all Americans, regardless of faith or race or gender. The good news is that there are Christian debt relief solutions available that c

Christian Alternatives to Bankruptcy – Consider Christian Debt Settlement The recent recession in the U.S. economy has created both employment and financial challenges for Americans and Christian families alike. Credit card debt problems will no doubt reach an all time high as unemployment rates continue to rise. Christians face the reality that filing bankruptcy may be their “only way out”, but that is not necessarily the only workable solution that may be available.

California Brain Injury Lawyers Experienced in Auto Accidents California is one of the most populated states and is known for its traffic congestion. The number of California auto accidents can be daunting. The NHTSA reported that there were 5,987,000 non fatal accidents in 2007; 2,491,000 of those car accidents resulted in injury. The Brain Injury Association estimates that 62 % of all transportation related Brain Injuries occur in an enclosed motor veh

Why Should I Hire a Seattle Real Estate Attorney? In every real estate transaction there are a wide variety of legal issues that must be taken care of. Contracts should always be reviewed by an attorney who understands the nuances of real estate law. But there are also state specific State laws to contend with. A Seattle real estate lawyer deals with a large number of State legal issues related to acquiring, financing, developing, managing, co

California IT Professionals – In Need of California Class Action Attorneys! It is hard to miss the wave of California wage and hour litigation related to California IT professionals and Computer employee overtime that has been sweeping California recently. Even the largest software and computer companies have paid out millions of dollars to employees wrongfully classified as “exempt”, or in other words, not entitled to overtime. A layperson would believe that with pr

Protect Your Mental Health With A Payday Loan Just when you thought that things couldn’t get any worse, more banks went under. More countries are declaring economic crisis. It seems that the world’s financial problems are bound to get worse. Even if you do not have considerable investments in various banks, I am sure that you are feeling the stress that results from these economic upheavals. I sure am. I am just an average person, with a

Free Bulk SMS services People are getting very busy these days without having enough time to talk unless it is very important. Mobile SMS have supported this need to contemporary times as now people do not want to call and enter in the unproductive conversation before coming up to the actual issue. SMS provides you the benefit to come straight to the point and also saves money. What if you get this totally free?

HELP – I Have IRS Levy Problems! If IRS collection notices are ignored, the IRS is forced to collect from taxpayers by force. They do this with their dreaded IRS levy. By law, the IRS has the right to levy bank accounts (IRS bank levy), garnish your paychecks (IRS wage levy), or even seize your assets. But you do not have to let the IRS bully you or your family. There are ways to stop an IRS levy. The first step is to know the

Why Use Professional Tax Debt Help? Good IRS tax relief is hard to find and for people with complicated tax issues, it is an absolute necessity. But how do you know which tax reduction firm is the best one to try? How can you be sure you're going to get the tax debt help that you need? And why is it so vital to receive help from professionals? Settling Your IRS Tax Debt For Less When your IRS tax debt is spiraling out

IRS Settlement – Can You Really Settle Your IRS Tax Debt for Less? It's possible to settle your IRS tax debt, but it presents a challenge. Proving you can settle your tax debt for less is a daunting experience. You have to contend with pages of IRS paperwork rife with technical terms. Settling tax debt is indeed a reality and it can be done. However, there's a lot you need to know before you attempt to settle your IRS tax debt. Rebuking the Lies - The

IRS Tax Relief – The Most Popular IRS Tax Relief Solutions Tax law provides many solutions for resolving tax debt. But if you were to contact the IRS directly, they would only alert you to one solution, and that's paying the tax debt in full. Here are five popular IRS tax relief solutions you should know about to be more informed. IRS Tax Settlement It is possible to settle your IRS tax debt. But there are some pitfalls you need to know. Fi

Hire the California Labor Board or California Labor Law Attorneys - You Decide With a downturn in the economy, many employers are cutting back on payroll. Unfortunately, some employers are reducing payroll costs by violating the California overtime laws. When this occurs, employees have essentially two options to recover their California overtime pay: the California labor board, or hiring California labor law attorneys. Although the California Labor Board is a commonly

Categories
Acne
Advertising
Advice
Aerobics-Cardio
Affiliate Programs
Alternative
Arts
Attraction
Auctions
Audio-Streaming
Autos
Awards
Babies-Toddler
Beauty
Blogging-RSS
Book-Marketing
Branding
Breast-Cervical-Ovarian-Cancer
Broadband-Internet
Build-Muscle
Business
Cancer
Careers-Employment
Casino-Gambling
CGI
Coaching
Coffee
College-University
Colon-Rectal-Cancer
Communications
Computers
Cooking-Tips
Copywriting
Crafts-Hobbies
Creativity
Credit
Cruising-Sailing
CSS
Currency-Trading
Customer-Service
Dating
Debt-Consolidation
Debt-Relief
DHTML
Diabetes
Direct Mail
Divorce
Domain Names
EBooks
ECommerce
Education
Elder-Care
Email-Marketing
Email Entertainment
Entrepreneurialism
Environment
Exercise
Ezine-Marketing
Ezine-Publishing
Family
Finance
Fishing
Fitness
Food
Free
Games
Gardening
Goal-Setting
Golf
Government
Grief-Loss
Hair-Loss
Happiness
Hardware
Health
Hobbies
Holidays
Home-Security
Homes
Home Business
Home Repair
HTML
Humanities
Humor
Innovation
Inspirational
Interior-Decorating
Internet-Marketing
Javascript
Kids And Teens
Landscaping-Gardening
Law
Leadership
Leases-Leasing
Legal
Leukemia
Link Popularity
Loans
Lung-Cancer
Lymphoma-Cancer
Management
Marketing
Marriage-Wedding
Martial-Arts
Medicine
Meditation
Men's-Issues
Metaphysical
MLM
Mobile-Cell-Phone
Mortgage-Refinance
Motivational
Multimedia
Music
Negotiation
Network-Marketing
Networking
News-and-Society
Newsletters
Nutrition
Off-Line Promotion
Online Business
Online Promotion
Organizing
Other
Outdoors
Page Rank
Parenting
Personal-Tech
Pets
Photography
Podcasting
Poetry
Politics
Positive-Attitude
PPC-Advertising
Presentation
Prostate-Cancer
Psychology
Public-Speaking
Publishing
Real-Estate
Recipes
Recreation
Reference
Relationships
Religion
Sales
Sales-Management
Sales-Teleselling
Sales-Training
Satellite-Radio
Satellite-TV
Scams
Science
Security
Self Help
Self Improvement
Sexuality
SE Optimization SE Positioning
SE Tactics
Shopping
Site-Promotion
Site Security
Skin-Cancer
Small-Business
Social Issues
Society
Software
Spam
Spirituality
Sports
Stocks-Mutual-Funds
Strategic-Planning
Stress-Management
Structured-Settlements
Success
Supplements
Taxes
Team-Building
Technology
Teleseminars
Time-Management
Traffic-Building
Traffic Analysis
Travel
Uterine-Cancer
Vacation-Rentals
Video-Conferencing
Video-Streaming
Viral Marketing
VOIP
Web-Development
Webmasters
Web Design
Web Hosting
Weight Loss
Wine-Spirits
Women
Writing
Yoga

Copyright © media13.Com  2005. All Rights Reserved.

Sources : SEO India - Internet web directory