I have a php application that contains about 50-55 code files. A file with a maximum amount of code has about 1200 lines of code (this includes spaces, tabs, and several line breaks ...), and the rest of the code files are relatively smaller than this.
The application code in almost every file is a combination of html, sql and php (what you call spaghetti), with the exception of a few files that contain files with pure php include ... for example, a file containing functions that are needed in many others places.
I am considering the appropriateness of reorganizing this application into an architecture like mvc.
Now I know that the mvc application offers many advantages, such as ease of maintenance, reuse and ease of further development, etc., but what about scalability and performance - especially in this case?
My assumption is that since this is a small application (I suppose that you think it is small enough?), I don’t assume that it’s difficult for you to work or add a few more functions (maximum) that just might mean a few add-ons to existing files or possibly add a maximum of 5-10 new files.
So, I think that I should not convert to mvc just for the sake of service.
As far as I understand, you can put each mvc component on a separate server to distribute the load, to have a different server serving html, database and logic, as well as do other optimization / caching to do this mvc and execute.
I think that although in a small spaghetti application we cannot have different servers for html, databases, etc., we can easily scale without sacrificing performance, having a load balancer in front of web servers, databae server, etc. d. (Suppose this is a situation where one server is not enough)
Moreover, spaghetti's own code should work better than mvc, since it does not have any overhead, such as a requirement, that includes either files or function calls from files located under folders belonging to another mvc component.
So, with all these things in mind, do you really think it is useful to reorganize a relatively small spaghetti application in mvc for scalability and performance?
Please do not tell me that refactoring will be useful in the future (I know this will help and consider whether we really need to add much more code to the existing code base), but please provide me with a clear answer to
1) Do I really need to convert this application to mvc architecture for scalability and performance?
2) Can a spaghetti application use this scale and execute at least 1 million requests per day, and half of which occurs during some peak time?