Most "we need to rebuild everything" calls are not rebuilds. They are one slow query, one missing index, and a database that has been holding its breath since 2019. Add the index. The rewrite meeting cancels itself, and so does the line item that was going to ruin your year.
I have been writing software for eleven years and I still open the slow page, hit the profiler, and find the same thing more often than I would like to admit in writing. The system is not rotten. It is waiting on one query that nobody has looked at since the person who wrote it left.
Why everyone reaches for the rewrite
A rewrite feels clean. A diagnosis feels like homework. So the instinct, when something is slow or scary, is to declare bankruptcy on the old code and start fresh. The trouble is that the new system inherits every requirement you forgot the old one was quietly handling, and you find them one production incident at a time.
What we check before anyone says rewrite
- Profile the actual slow path. Not the one you assume is slow. The one the data says is slow.
- Look for the missing index. It is genuinely the most common single fix, and it is almost free.
- Check the N+1 queries hiding behind a clean-looking loop.
- Read the cache that is either missing or lying.
- Only then ask whether the foundation can hold the next feature.
When the rewrite is actually real
Sometimes the foundation genuinely cannot hold what you need next, and a rewrite is the honest answer. When that is true, we phase it. The new system grows up next to the old one, takes over in slices, and the business keeps running the whole time. Big-bang rewrites are how good teams lose a year and a few good engineers.
If Shawshank taught us anything, it is that the slow, unglamorous work behind the wall is what eventually sets you free. Same with a good refactor.
The honest version of the pitch
We make more money from a rewrite than from an index. We still lead with the index, because the fastest way to earn the rewrite later is to fix the cheap thing now and be right about it. If your system is slow but you have never profiled it, do that first, even without us. Half the time the fix is free, and a free fix is a great way to start a relationship with the people who found it.