When to refactor vs. rewrite your SaaS codebase

Executive overview

Developers and CTOs push for full rewrites. Almost always, that's the wrong call. A refactor — modernising code incrementally without discarding the core data structure — is faster, cheaper, and keeps you competitive.

The only valid case for a full rewrite is structural: no relational integrity, flat-file data, or hard-coded keys that can't be rescued.

A working codebase with revenue is an asset, not a liability — treat it as one.

Love your legacy code

  • Revenue and customers prove the current code works at some level.
  • Technical staff will always argue for a rewrite; push back unless there are genuine data-structure or security issues.
  • If the core data structure is sound and security holes can be patched by upgrading components, refactor instead.

Think small

  • Scoping a full rewrite invites feature creep: engineers add new ideas mid-flight and timelines double.
  • Estimate inflation is real: a "six-month" rewrite routinely becomes one to two years.
  • Maintaining two parallel code bases (classic + new) bleeds engineering capacity; avoid it.
  • Target the smallest granular piece that can be extracted and improved independently.

Focus your fix

  • Ask the engineering team: "What breaks if we 10x load tomorrow?" — fix that first.
  • Use the house-remodelling mental model: don't gut the kitchen (core transaction flow) first; start with the bathroom (low-traffic, lower-risk modules).
  • Build refactoring skills on lower-risk areas before tackling the most disruptive parts of the system.

Be quiet

  • Announcing rewrites or new versions publicly creates commitments you can't walk back.
  • Frustrated partners or customers are not a reason to promise a big new release date.
  • Treat version improvements as continuous cultural practice, not launch events.
  • Balance three competing needs within engineering capacity: business needs, customer needs, technical debt — none can dominate indefinitely.

Respect your life cycle

  • Software development life cycle (SDLC) covers how features are scoped, built, tested, QA'd, and deployed.
  • Maturity indicators: deployment frequency and test coverage — low on either signals a broken process.
  • Agile/Scrum and CI/CD (continuous integration/continuous deployment) are the baseline; implement both before attempting large refactors.
  • Frequent "hot fix" conversations with your team signal you are moving too fast; slow down.
  • Founders should not override the process by demanding emergency patches; it erodes the discipline that makes refactoring safe.

More like this — when you're ready for early access.

Join the waitlist for a personal account and content recommendations based on what you're working on.

No spam. Unsubscribe at any time.

You're on the list. We'll be in touch before launch.

Get early access to the full library.

Join the waitlist for a personal account and content recommendations based on what you're working on.

No spam. Unsubscribe at any time.

You're on the list. We'll be in touch before launch.

Be among the first to get personalised recommendations tailored to your stage in business.

No spam.

You're on the list. We'll be in touch before launch.

Be among the first to get personalised recommendations tailored to your stage in business.

No spam.

You're on the list. We'll be in touch before launch.