Monday, May 16, 2011

Life Moves

When we build systems, we tend to think about the system as it is now. We think of it as a set of behaviors and database tables and APIs and code and data and users - all as they are now. It's a point-in-time thought process.

Too bad that only happens once per system.

There's only ever one fresh deployment. There's only ever one initial state. After that, we have to handle the system as it moves through time - deployments become upgrades rather than clean installs. APIs have to be backwards compatible (or not, but we have to think about it at least). Users have whatever attributes and data they had when they signed up, and that's not magically going to change just because new users have an additional attribute.

Life moves. Systems move. And we are freighted with our past.

The good news is we can handle it. There are deployment utilities that handle database migrations really well (ref. Capistrano or Puppet). There are defaults and diff utilities.

The only movement we can't prepare for is the one we didn't think about.

So every time you add something to your system, or take something away, stop and say, "what about the past?" It's a lot easier to do this when we're building the feature than to wait until just prior to deployment. If we wait, that's when we start to see bugs like, "if I do this with user X I see the problem but if I do it with user Y then I don't", and it takes some digging to realize that user X was created before the new feature was added, but user Y was created after. In other words, it gets to be a headache.

So save yourself the headache and ask yourself what to do about the past every time you take a step toward the future. Live moves. Let's move with it.


No comments:

Post a Comment