My name is Dan Shipper, I’m a freshman in college, and I’ve been programming for 9 years. Two months ago I met Wesley Zhao and Ajay Mehta and we started hacking small websites together. Our second project turned into what is now WhereMyFriends.Be which is a small app that shows you where your Facebook friends are on an interactive Google Map. The site was featured on Mashable and CNN and promptly went down. We spent the next four days trying to get it back online and working. This is what I learned.
1. Prepare for the worst. We originally had our site on a GoDaddy VPS server. I would say that it lasted about a minute after the Mashable article was posted. From then on we were scrambling to switch hosts as quickly as possible and minimize down time. If we had just ponied up in the beginning for a Rackspace setup (I love them) we would have been much better able to capitalize on the traffic we were getting. As it is we signed up almost 10,000 users but still – prepare for the worst.
2. Use memcached. I can’t tell how much this will speed up your site if you get a bunch of visitors. Put it in at the start and rest easy.
3. If you must use MySQL use InnoDB database tables instead of MyISAM if you have a lot of DB reads and writes. While MyISAM is a little bit more robust and can hold more data, for a high traffic database with a lot of concurrent reads we have found that InnoDB works better. You can read more here.
4. Never store something that you know to be numeric as a string. For some reason we were doing this with our Facebook oauth_ids (probably just an oversight.) It doesn’t seem like a big deal but changing the way we stored oauth_ids singlehandedly decreased our page load time by at least 5 seconds.
5. Pitch, pitch, pitch. We released WhereMyFriends.Be and told our friends about it. A lot of them used it and we got pretty good traction but the site didn’t spread past our own personal network for about 3 days. Then we started emailing tech sites like Mashable, TechCrunch etc. A few days later we were published on Mashable. Now we sign a new user up every 10 seconds. Pitch your idea. If no one hears about it doesn’t matter how good it is.
6. Take advantage of community members who want to help you. Sites like Hacker News have great people who have experience and will be willing to help you out. Don’t ignore them. Solicit their advice and listen. It could save your site. Another great place to go is the #startups channel on the Freenode IRC Network.