Archive for May, 2011

PHP/MySQL Performance Series: Part 1 – Adding Indexes, Optimize Tables

When trying to optimize the performance of your MySQL database, the first thing you try is often the most futile:

Table Optimization.

We put this first because it’s often the first “fix” people arrive at when trying to fix performance problems, but we think it’s almost never the solution, so we want to get that out of the way first. Generally speaking, most Mysql tables are created in a very optimum way. 5-10 years ago that wasn’t necessarily the case, however these days most problems are caused at the application-level or table-desgin-level (aka. Improper use of tables or improper table structure). It might be worthwhile to skip this article, but it’s a good idea to keep Table Optimization in mind, just don’t assume that’s going to be some magical fix. (more…)

Adobe: The story of software gone wrong

Adobe has been a leading software developer for many years. Their software has helped take digital media to a whole new level.

Adobe began with a few simple products, and Adobe Photoshop and Illustrator became the front-runners – the symbols of what Adobe could do. These two pieces of software set the stage for graphic design for years to come.

Over the years Adobe both developed and acquired additional software that fit into their business model. They acquired Macromedia who had themselves acquired software (Allaire Homesite) and developed a variety of software including Macromedia Dreamweaver, Macromedia Flash and Macromedia Director. (more…)

MySQL: Proper Pronunciation

MySQL is the subject of a common debate: How to pronounce it properly. The proper pronunciation of MySQL is:

“My S-Q-L”

Many people use the short-hand version

“My Sequel”

This is 100% wrong, and the only correct way to say it is the first way – “My S-Q-L”.

 

Okay, if you are frustrated with what I’ve said, just calm down and realize the sarcasm. Nobody cares how you pronounce it, there is no “correct” way, just say it how you wanna say it.

Glossary: LAMP Programming

I love lamp.

LAMP programming has been around for many years. Although there are many variations, it normally stands for:

Linux Apache Mysql Php

Through the years, there have been many variations. For a long time, until PHP became popular, the P stool for Perl. Some people might argue that the P stands for Python. Eh, not really, PHP is much, much more widely used. (more…)

PHP/MySQL Performance Series: Part 3 – Check yourself before your wreck yourself (Dealing with SQL problems)

If you’re problem is your SQL, chances are you’re going to go about fixing it the wrong way. What is the “wrong way”? Trying to optimize Mysql settings is often a sign that you’re heading in the wrong direction. What should you do? Look at your SQL. Yes, just look at it.

That’s assuming you know what SQL is the problem. If you aren’t quite sure, try looking into Mysql’s Slow Query Log. Also use “mysql -e” or “mysqladmin processlist”. Maybe even make a cron to monitor this so you can go back and look at the logs. Bottom line: figure it out yourself, that’s not for this article. (more…)

Glossary: SLD and ccSLD (Second Level Domain, and country code SLDs)

A SLD or “Second Level Domain” is all often called the “domain” or “base domain.”

Most of the time when people buy a domain, they are buying a Second Level Domain. To get even more specific, they are buying a SLD + TLD combination.

When a ccSLD – or “country code Second Level Domain” – is used, then a user will actually be buying a third level domain.

ccSLDs can make it difficult for developers to deal with domains, in the sense that many developers have to parse out URLs for many reasons, but there is no hard set rule on how to parse a domain out. You just have to have a comprehensive list of all ccSLDs and their corresponding ccTLDs in order to properly distinguish the users “base domain” from their “domain extension.”

Glossary: Domain Extension (aka. TLD, ccTLD and ccSLD)

A “domain extension” is slang for “Top Level Domain” or “country code Second Level Domain + country code Top Level Domain”.

In other words, if you buy “example.com” – “example” is your “base domain” and “.com” is your domain extension. In this case, your base domain is your “Second Level Domain” and your domain extension – “.com” is your TLD.

On the other hand, if you buy “example.co.uk” then “example” is still your base domain but “.co.uk” is your “domain extension”. In this case, your “base domain” is your “Third Level Domain”, and your “domain extension” – “.co.uk” – is your SLD + TLD.

Glossary: TLD and ccTLD (Top Level Domain, and country code TLDs)

A “TLD” or “Top Level Domain” is also commonly known as a “domain extension.”

We actually just prefer the term “domain extension.”

Examples of TLDs are:

.com
.net
.org

Examples of ccTLDs are:

.uk
.au

A ccSLD – or country code Second Level Domain, is often mistaken for a TLD, however they are actually two separate domain levels. For example “.co.uk” is two domains: “.co” os a ccSLD and “.uk” is a ccTLD.

See SLDs and ccSLDs.

How do I parse out the subdomain from the TLD in PHP?

How do I use PHP’s parse_url() function to separate out the base domain from the domain extension?
How do I use PHPto extract the domain from a URL?
How do I extract the domain when it is using a ccSLD, or “country code second level domain”, such as .com.au and .co.uk?

PHP’s parse url function is quite handy, but not all powerful, and it cannot distinguish between domains and subdomains. (more…)

Glossary: Deprecated (aka. Decapitated)

“Deprecated” is a term used in programming to describe when a function or other feature should no longer be used.

Because of the fact that the term “deprecated” is fairly industry-specific to programming, we choose instead to call it “decapitated”. We think this is a more accurate description.

“Deprecated ” is often used in PHP because of he numerous iterations PHP has gone through. PHP describes many functions as deprecated because they were used in PHP 4 but were dumped in PHP 5. PHP also has many significant upgrades between version – subversions that have many more differences than average. PHP 5.3 is a great example of this, but there are many more significant sub-versions. (more…)