When to Rewrite Your MVP (and When Not To)
Most MVPs should be improved, not rewritten. A full rewrite is justified only when the current code blocks the business in a way incremental changes cannot fix: the stack cannot meet a hard requirement, the data model cannot represent how the business now works, there is a security flaw in the foundations, or nobody can safely change the code. Otherwise, refactor in steps while you keep shipping. This guide is for founders deciding what to do with a working prototype that is starting to strain, and it covers the signs on both sides and a safer way to get from MVP to production.
Why Is Rewriting So Tempting?
Rewrites are tempting because the problems in the current code are visible and the problems in the new code are not yet. Developers see every shortcut taken under deadline pressure. Founders see features slowing down. A clean start promises to fix both.
What the clean start hides is that the old code also contains every lesson the product has learned: edge cases customers hit, fixes for payment failures, the odd rule a big client needed. Most of it was never written down. A rewrite has to rediscover all of it, usually by breaking it in production first.
What Does a Rewrite Really Cost?
A rewrite costs more than the engineering time:
- Feature freeze. New work slows or stops, or gets built twice, once in each version.
- Hidden behavior. The new system must match what customers rely on, including undocumented behavior.
- Migration risk. Data has to move from the old model to the new one without loss.
- Opportunity cost. Months spent reaching parity are months not spent on what customers asked for.
I covered how these costs show up on a balance sheet in what technical debt really costs your business. A rewrite is a way of paying that debt all at once, at the most expensive rate.
When Is a Rewrite Justified? Five Signs
A rewrite is worth considering when you see one or more of these, and can point to evidence:
- The stack cannot meet a hard requirement. A no-code tool that cannot handle your data volume, a platform that cannot meet a compliance rule your customers require, or a framework that is no longer maintained.
- The data model contradicts the business. For example, the MVP assumed one user per account, and the business now sells to teams. When the core model is wrong, every feature fights it.
- There is a security problem in the foundations. Passwords stored badly, no real access control, or tenant data that is not separated. Some of these can be fixed in place, but if the flaw is everywhere, starting fresh can be safer.
- Every change breaks something unrelated. When small, isolated changes routinely cause failures elsewhere and there are no tests to catch them, the cost of each feature keeps rising.
- Nobody can change it safely. The original developer is gone, the code is undocumented, and every change is a gamble.
When Is a Rewrite the Wrong Call? Four Signs
- "The code is ugly." Ugly code that works and changes safely is a refactoring problem, not a rewrite problem.
- A new developer prefers a different stack. A preference is not a requirement. Ask what the current stack cannot do.
- Features are slow, but nobody knows why. Measure first. The bottleneck is often process, unclear requirements or one tangled module, not the whole codebase.
- You have not validated the product yet. If you are still finding product-market fit, a rewrite spends your runway polishing something that may change completely.
How Do You Decide? A Simple Test
Answer these four questions with evidence, not impressions:
| Question | Points toward refactor | Points toward rewrite |
|---|---|---|
| Can the current stack meet every hard requirement in the next 12 months? | Yes | No, and it cannot be extended |
| Does the core data model match how the business works now? | Mostly | No, and it affects most features |
| Can a developer make a small change without breaking unrelated things? | Usually | Rarely, even with care |
| Is the product validated with paying or active users? | Not yet, or yes and growing | Yes, and growth is blocked by the code |
If most answers point to refactoring, refactor. If two or more point to rewriting, get an independent review before committing, because the people closest to the code are also the most eager to start over.
What Is the Safer Way to Move From MVP to Production?
The safer path is usually an incremental replacement, often called the strangler fig pattern:
- Draw the boundaries. Identify the parts of the system: authentication, billing, the core workflow, reporting.
- Add tests around what exists. Before changing a part, capture its current behavior in tests so you know when you break it.
- Replace one part at a time. Build the new version of one part beside the old one.
- Route traffic gradually. Send one feature or a small percentage of users to the new part, compare results, then switch fully.
- Remove the old part. Only when nothing depends on it.
The product keeps running, every step can be rolled back, and you can keep shipping features in the parts you are not replacing.
For the parts you do rebuild, design them as you would a new production system. My guides to a production Node.js and TypeScript REST API and system design for AI-powered SaaS cover the patterns I use.
What If You Really Do Need a Rewrite?
Sometimes the evidence is clear. If so, reduce the risk:
- Write down what the current system does before you start, including the strange rules. These become the requirements for the new build.
- Freeze scope. Match current behavior first; add improvements after launch.
- Migrate data early and often. Run the migration repeatedly against real data long before cutover.
- Plan the cutover and the rollback. Decide how you will switch, and how you will switch back if something goes wrong.
- Keep the old system running until the new one has handled real traffic without problems.
Who Should Make the Call?
Not the person who will do the rewrite alone, and not the founder alone. The best decisions come from someone who can read the code and also understands the business constraints: budget, deadlines and what customers depend on. That is the kind of technical consulting I do with founders: a short, independent look at the code and the business together, ending in a clear recommendation and a plan. If you are hiring help for the work itself, my guide to hiring your first developer covers what to look for.
Frequently Asked Questions
Should I rewrite my MVP or refactor it? Refactor in most cases. A full rewrite is justified only when the code blocks the business in a way incremental changes cannot fix, such as a stack that cannot meet a hard requirement or a flaw in the foundations. If the product works and customers use it, improving it piece by piece is usually cheaper and less risky.
How do I know if my MVP needs a rewrite? Look for evidence, not frustration: changes routinely breaking unrelated things, a data model that cannot represent the business, a stack that cannot meet a hard requirement, a foundational security problem, or code nobody can safely change. Slow features or ugly code alone are not enough.
What is the strangler fig pattern? A way to replace a system gradually. New functionality is built next to the old one, and traffic for one feature at a time moves to the new version until the old code can be removed. The product keeps running, and each step can be rolled back.
How long does it take to rewrite an MVP? Usually longer than the original build, because the rewrite must match every behavior customers rely on, including undocumented ones. Expect feature work to slow or stop while a big-bang rewrite is in progress.
Can I keep shipping features during a rewrite? With a big-bang rewrite, mostly no. With an incremental approach such as the strangler fig pattern, yes, which is one of its biggest advantages for a startup that cannot afford to stop for months.