Categories
Programming

Dev to Staging to Production

How do you keep your development work from interfering with testing new features and providing a stable application to your users? Create a dev to staging to production chain.

You’ve worked for months on a Web application, you launch and all is fine. Now you need to add a new feature that will take you at least a few hours to get right. Do you subject your users to the errors that will intermittently appear if you code directly on the site? No, of course not. You make a completely separate installation that only you’re looking at. When the feature seems solid, push the changes to the production version. You are using a source code repository, aren’t you? So, just perform a svn update on the live site and you’re all good.

Diagram showing flow of code changes from dev to staging to production
This diagram shows the relationship between development, staging and production servers.

Following is the method I’ve found works best for smallish teams working on LAMP Web apps where you can’t afford to introduce bugs to the production version. This method has worked for me on teams of 5-10 coders, each working on different features at once. There’s a balance to be struck between not getting in the way of development work and getting updates out promptly. It’s a drag when you can’t release one feature because its code is all mixed in with another, half-finished feature.

The main idea to have one checkout for your production version, one for a staging and testing version, and multiple servers for various developers and/or projects. Changes that are ready to be tested are checked into the repository. When you want to release, you freeze checkins and test the staging server. When you’re convinced it’s all good, you run an update on the live server and allow checkins again. You’ll want at least three different databases, one each for live, staging and development.

For relatively short-term work, developers should usually check in frequently. For long-term projects, checkins should be held back. Yes, this is what branches are for, and that’s the right choice for more senior coders. In practice, branches don’t seem to be something that the junior members can grok. I might have junior developers working on big changes to copy over many weeks. I simply rely on backups to make sure they don’t lose work in case of disaster.

Here’s a set of steps I might take to set up a new development system.

  1. Create a subversion repository.
  2. Create three virtual hosts: www, stage, and dev.
  3. Create three databases.
  4. Checkout the app once each for www and stage. You’d view these sites as www.example.com and stage.example.com.
  5. Make an open directory for the dev subdomain and make a checkout for each developer. You’d view these sites as dev.example.com/coder1/htdocs. Allow all the dev versions to share a database.
  6. Protect the dev server from the public with basic authentication. You don’t want Web robots indexing everything, and you don’t want to expose scripts that would be outside of the apache webroot in production.

This system will allow you to quickly make a new checkout without hassling with making new subdomains and tweaking the apache config.

Categories
Business Personal

Eighteen Intelligence

Leon AtkinsonMy life has been quite busy lately. After nearly two years as VP of Engineering for BTS, I left to start a consultancy. It began with a casual comment to a few friends that if they had 2-3 months worth of work for me, I’d consider cutting loose. Mark Celsor has been dealing with a flood of new business in the past quarter and was eager to have me work with Vine Street Interactive. Meanwhile, Jenny Martin asked me if I knew anyone available for Facebook API work. Fortunately–or unfortunately depending on perspective–both of them wanted my help right away. Saying yes to either of them meant saying goodbye to BTS. Saying yes to both of them meant saying goodbye to daylight….well, nearly so.

Since October, I’ve been working two full time gigs while also making preparations for the launch of my new company, Eighteen Intelligence Corporation. For tax reasons, the paperwork won’t be filed until January. California makes all corporations pay a minimum of $800/year in taxes, so it makes sense to start a company early in the year. I’ve been trying to work about 10-12 hours/day 7 days/week for more than a month. I’ve had to take a day off here and there to prove to my family and myself that I still exist. I see light at the end of the tunnel now, as one of the two projects is going into the bug-checking phase and should launch in a couple of weeks.

I hope the other project wraps up mid-December and leaves me a couple of weeks to enjoy the holidays. I expect to available to you help you with projects in January. How can I help you? Thanks for asking! If you’ve worked with me, you know what I’m capable of. (Horrible, isn’t it?) I’m concentrating on building Internet applications, particularly those integrated with Facebook. I’d enjoy helping you start from a requirements specification and see the project all the way through launch. I can help in a CTO-ish way to set up best practices for your team, or I can be a really fast coder who helps you make an insane deadline.Eighteen Intelligence Logo

You can read more blah-blah-blah marketing stuff at the 18int.com Web site. Please contact me about any opportunities for us to work together. Thanks! And since it is the season, I should also thank a few people who’ve helped me out recently. Thanks to the BTS folks for employing me. Thanks to John Szeder for sending leads and projects my way. Thanks to everyone who’s already asked about my availability. Thanks to Kathy Marshall for accounting advice. Thanks to Jenny and Mark for the projects that enabled me to launch this adventure. And of course, thanks to Vicky and Tre and Henry for putting up with me toiling in the basement office.

Categories
Business

The Fractional CTO

Silly pie chart illustrating the idea of a fractional CTO.
Proproportions shown for illustration purposes only. Actual sizes may vary.

One of my favorite things is solving technology problems. Fortunately, I get paid for that. Unfortunately, I’d rather do more of it. Therefore, I’m putting out a call to anyone interested: if you need a fractional CTO, ask me.

My friends introduce me to other entrepreneurs and describe me as a genius. They usually skip the “evil” prefix. It’s true, I’ve been hacking around in the Web space for a long time now, and I have a few tricks to share. I tend to underestimate what I can do, so I defer to their judgment.  What I do know is how much I enjoy helping someone else figure out a tough technical problem. Lately, I’ve been thinking I’m not getting enough of that. I’ve been asking people one-by-one, and now I’m putting the question out to a wider audience. How can I help you?

One recent example is a social games company that needs help profiling their PHP scripts. That’s something I’ve had to do many times over the years. Actually, it was really important when we were coding apps in PHP3. I’ve also been offering advice to a several startups who are trying to get to an alpha version. And I’ve been helping my friend John Villarreal juice up his media business.

So I’ve landed on this concept of the fractional CTO. If you could use the services of a CTO for a day or two a month, please let me know. I’m happy to help.

Categories
Personal

Car Damaged, Repaired

In June, I was rear-ended on my way home from work. I’d been doing the Martinez-to-Berkeley commute via I-80 for seven years, so I was probably due for some teenager to run into me. Neither of us was hurt. I was stopped and she wasn’t looking. Since I pay for collision insurance, I knew I’d only be out a grand, max. As it turns out, her insurer agreed that it was 100% her fault and agreed to pay my deductible. The damage was north of five grand. It took a month, but I got my car back, and I cannot tell that it’s been in the shop.

State Farm Insurance
Image via Wikipedia

A curious thing happened the week I got it back. I got a letter from my insurance company, State Farm, telling me that I was more than 51% responsible. They had already paid for the repairs, so it didn’t make a lot of sense. I complained and the next Monday they got back to me and apologized for the mistake. My agent, Mark Woodard, called me to let me know and he followed up with the adjusters. A few days later, I got an apology in the mail. Also, this weekend I got another letter telling me they’d checked in to make sure I got the check from the other insurance company to cover my deductible.

So, all’s well that ends well. I just wanted to note publicly that while it was annoying to get the mistake letter, everything else about the service I got was great. The repairs were done by Haw’s Auto Body in Concord. They weren’t fast, but they were clearly working hard to get the best parts.

Categories
Personal

Back up your phone’s contacts easily with Ubuntu and Bluetooth

I’m preparing to hand down my LG Lotus to my wife, who has coveted it since I brought the cute purple phone home, and upgrade to an HTC Evo. We were anticipating the pain of re-entering contacts, so I tried BitPim, software I hadn’t used for several years. It failed on both of our current phones. I was about to go with Sprint‘s solution for backing up contacts but then I discovered that if you’ve got a bluetooth radio, you can easily move contacts to and from the phone.

Official Ubuntu circle with wordmark. Replace ...
Image via Wikipedia

Vicky’s new(ish) laptop has bluetooth. I hit the function key and the little applet fired up. I told my phone to make itself visible for 3 minutes and paired it with the laptop. This is all painless and mostly automatic through the applet. I played around and could move files between the two, but contacts wouldn’t send. Then I discovered that you have to tell the applet that it’s OK for the phone to send it contacts. It’s a button under the list of known devices. The Lotus has a menu item for sending all contacts, and they came over quickly. Vicky’s lame Samsung SPH-M220 requires clicking on a contact, going through the whole process of connecting via bluetooth and then sending…for each contact. She’s going through her list right now.

Once again, it just works on Ubuntu.