Status 200 != OK?

When you think about SEO do you remember to think about how your website handles HTTP status codes? The odds are that you don’t. Your “page not found” probably returns a 404 (everyone knows about that one) but what about programmatic error pages or login pages? Search engines index pretty much anything that has a 200 status code. This means if you don’t pay attention you can end up with pages indexed & findable that shouldn’t be.

For example, if you are logged out, Washington Post’s newsletter page 302 redirects you to a login page that then serves a 200. This means a Google search for newsletters for gets indexed with the text from the login page. If they were to serve a 401 “Unauthorized” on the pages that require logins, these login pages would not be indexed. Use caution with that scenario though. It might be better to handle search engines differently than normal users so the content can be indexed.

Read on for more examples

Posted under Internet, SEO, Tips & Tricks, Web Development

This post was written by Michael Tougeron on June 11, 2009

Tags: , , , , , , ,

How FriendFeed uses MySQL to store schema-less data – SF MySQL Meetup April 6th, 2009

When: 6:30pm Monday April 6th, 2009
Where: CBS Interactive – 235 2nd Street San Francisco, CA
RSVP: How FriendFeed uses MySQL to store schema-less data

Join the SF MySQL Meetup for our April meetup where Bret Taylor from FriendFeed talks about how they store their data in a "schema-less" system on top of MySQL. FriendFeed stores over 250 million entries and a bunch of other data, from comments and "likes" to friend lists.

As the database has grown, they have tried to iteratively deal with the scaling issues that come with rapid growth. They did the typical things, like using read slaves and memcache to increase read throughput and sharding our database to improve write throughput. However, as FriendFeed grew, scaling their existing features to accommodate more traffic turned out to be much less of an issue than adding new features.

In particular, making schema changes or adding indexes to a database with more than 10 – 20 million rows completely locks the database for hours at a time. After some deliberation, FriendFeed decided to implement a "schema-less" storage system on top of MySQL rather than use a completely new storage system. This talk attempts to describe the high-level details of the system.

More about the event after the break

Posted under Events, Internet, mysql, Technology, Tips & Tricks, Web Development

This post was written by Michael Tougeron on March 28, 2009

Tags: , , ,

Diving into the Yahoo! Open Stack – SF PHP Meetup April 2nd, 2009

When: 6:30pm Thursday April 2nd, 2009
Where: CBS Interactive – 235 2nd Street San Francisco, CA
RSVP: Diving into the Yahoo! Open Stack

Join the SF PHP Meetup for an exploration into the Yahoo! Open Stack and learn how to leverage Yahoo’s platforms and scalability to build your next application. We will examine the components that make up Yahoo’s open stack: developer tools (YUI), data apis (YQL, BOSS), social apis, and the application platform (YAP).

  • Overview
    • What is the Yahoo! Open Stack?
      • Developer Tools – YUI, Tutorials
      • YOS SDK for PHP
    • Data APIs – YQL, BOSS …
    • Social APIs – Profiles, Connections, Updates, …
    • Application Platform
      • OpenSocial Support
  • How does it all work?
    • Development Workflow
  • Building an open application with PHP and YOS
  • Common Problems & Solutions
    • CAJA
    • OpenSocial

More about the event after the break

Posted under Events, Internet, PHP, Technology, Tips & Tricks, Web Development

This post was written by Michael Tougeron on March 11, 2009

Tags: , , , ,

svn pre-commit & post-commit hooks

I have to say I love subversion (svn) hooks.  I’ve only been playing around with the concept fairly recently and I’m surprised that I lasted this long without them.  I wanted to take a few minutes and share my favorite ways of using them.  As well as a few that I don’t use but I think could be pretty helpful.

Before we keep going, if you don’t know what svn hooks are you can read up on them at is my reference site of choice whenever I need to look up a svn command.

My #1, all-time, greatest in the world, bestest favorite is a svn pre-commit hook to syntax check my PHP code.  There is nothing I hate more than a developer checking in code with syntax errors and breaking qa or stage or even, god-forbid, production.  It’s as easy as setting up the hook to run a script that calls “/path/to/php -l /path/to/file.php” and on failure reject the commit.  This way code that has syntax errors will never make it into SVN.  Now if only open-source projects like ZendFramework did something like this before releasing their code.  To be fair, the syntax errors are in their documentation not in the /library/ files but that’s still pretty dumb & annoying.

Another nice way to use a post-commit hook is to run something like PHP_CodeSniffer against the commit.  CodeSniffer is an awesome PEAR package that scans your file and flags coding standards violations.  It comes pre-packaged with sniffers for the PHPCS, PEAR, Squiz and  Zend.  Set it up to run and if it finds coding standard violations you can have the hook send out nasty little blame messages.  😉  This isn’t something that I’d want to run on pre-commit just in case you really need to get something into production NOW.  But if I hosted an open source project, I’d consider it.

Having minified JavaScript & CSS has become the standard way of serving JS & CSS.  But who really wants to take the time to minify or combine them?  Once again, enter svn hooks.  One of the developers set this up for GameSpot and it has been working great!  Basically it checks the commits against a defined naming standard, file.src.js or file.src.css, and then runs the YUI! Compressor on it and commits in file.min.(js|css).  He also made it check a global.conf in the file’s directory so it came mash up smaller js files into a global.min.js so we serve one file instead of ten.

Of course, let’s not forget about what is probably the most common svn hook; the post-commit email hook.  I like svnmailer better than that comes with svn by default.  I think it’s easier to configure/change and to setup rules for how you want the emails to look or where to go.

If you’re using a ticket tracking system like Bugzilla or Trac that doesn’t have its own way of peeking into svn (like JIRA can with this plugin) you can write a post-commit hook to update the ticket when something is committed.  You can see how Trac recommends you do it at

To help you on the way to creating your own svn hooks, tigris has a few hooks that are distributed with svn.  They can be quite helpful so you should take a look at them.

Posted under PHP, Tips & Tricks

This post was written by Michael Tougeron on March 7, 2009

Tags: , , , ,

Introducing the Tungsten Replicator for MySQL – SF MySQL Meetup Feb 2nd, 2009

Almost everyone I’ve ever talked to about MySQL has some complaint or another about its replication.  So when Robert Hodges, CTO of Continuent, offered to speak about the  Tungsten Replicator open source project at the February 2nd SF MySQL meetup I was all for it!  Now I know what you are thinking… “Not another sales pitch!”  But have no fear, Robert is one hell of a smart guy and is much more of a techie than a CTO (in a good way).  I remember one sales call where Robert came to CNET to talk about Continuent’s clustering software and we ended up spending more time talking databases in general than about the product.  🙂

So if you’re in the SF area on Monday Feb 2nd, 2009, stop by the CBSi building and listen in.

When: 6:30pm Monday Feb 2nd, 2009
Where: CBSi – 235 2nd Street San Francisco, CA

Description from the SF MySQL Meetup calendar:

Tungsten Replicator is a new open source project for database replication. It offers MySQL to Oracle replication, robust handling of master failures, extremely flexible topologies, and an extensible architecture that allows you to add your own replication features if you don’t find them there already. I’ll describe why MySQL needs more replication, show the product architecture, describe some of the problems it solves, and demonstrate the replicator in action. Finally, we’ll play “stump the chump” where you can present your replication problem and I’ll describe how our replicator handles it. Whether you have a tricky replication problem or are just curious about the subject, please join us. This is a very technical presentation that should be of interest to all true MySQL fans.

More information on Tungsten Replicator:

Posted under Events, mysql, Technology

This post was written by Michael Tougeron on January 24, 2009

Tags: , , , ,