Three Ways To Refactor a Legacy System – A Cheesy Analogy

Software is immortal, but systems age. They reach maximum capacity and can’t scale to support additional clients. They get twisted into knots as your business evolves in ways the system wasn’t designed to support.

Without constant vigilance you end up with a system that your developers hate to work on and your clients find frustrating. You realize the current system is holding your business back and ask for options.

The most common answer, unfortunately, is the “6 month rewrite”, also known as “a big bang.” Just give your developers 6 months and they will produce a new system that does all of the good things from the old system, and none of the bad.

The “6 month rewrite” almost never works and often leaves your company in a worse situation because of all the wasted time and resources. I’m going to try and explain why with a very cheesy analogy, and suggest 2 much more effective strategies.

A very cheesy analogy

Imagine, that this piece of string cheese is your system:

“A 6 month rewrite” or “big bang” is the idea that your developers are going to shove the whole thing in their mouths and chew the whole log.

You won’t really see any progress during the system mastication, but you’ll be able to see the developer’s jaws chewing furiously.

6 months is a long time to have developers working on one and only one thing. Especially when the chewing takes longer than expected and you reach the 9, 12, 18 month point. If you stop you’ll be left with this:

Your original system. Worse for the wear and tear, but fundamentally, the original system that is restricting your business.

It’s the worst of all worlds, you get no value unless the whole cheese is chewed, and you loose all the potential value if you stop!

Cut it up INTO small pieces

A great strategy when your system is failing due to scaling issues is to cut it up and refactor small pieces. Scaling issues include your system not being fast enough, unable to handle enough clients, or unable to handle large clients.

You can analyze which of these pieces are responsible for the bottlenecks in your system and tackle just those pieces:

And if you have to stop work on a single piece?

Your potential loses are much smaller.

Steel threads

When your system has been tied in knots due to changing requirements, replacing individual pieces won’t help. Instead, try peeling off small end-to-end slices, creating stand alone pieces that work the way your business works now:

This is the “steel thread” or “tracer bullet” model for refactoring a system.

It allows you to try small, quick, ways to build a new system. Each thread adds immediate value as it is completed. You don’t run the risk of having a large body of work that isn’t helping your clients.

Like the “small pieces” strategy, you can stop and start without much loss.

Conclusion

6 month rewrites are risky and likely to fail and leave you with nothing of value from your investment of time and resources. Small piece and steel thread strategies offer ways to quickly get incremental value into your client’s hands, and greatly reduce the risk of wasted work. They’re your best alternative to a total rewrite!

Leave a Reply