The closer your “Scale up” button is referencing actual hardware, the less of a problem it is.
The closer your “Scale up” button is referencing actual hardware, the less of a problem it is.
Chances are high that you won't get it right from the beginning, you can create these abstractions once you really understand the problem space with real world data.
When you get to that point I have another pro tip: Don't refactor, just rewrite it and put all your learnings into the v2.
Refactoring such a codebase while keeping everything running can be a monumental effort. I found it very hard to keep people who work on such a project motivated. Analyzing the use cases, coming up with a new design incorporating your learnings and then seeing clear progress towards the goal of a cleaner codebase is much more motivating. Engineers get the chance to do something new instead of "moving code around".
I'm not saying rewrite everything. When you get to this point it usually makes sense to start thinking about these abstractions which I advised to avoid in the beginning. You can begin to separate parts of the system by responsibility and then you rewrite just one part and give it a new API which other parts of your system will consume. Usually by that time you'll also want to restructure your database.