I know this may be a general question, but what exactly goes into scaling for all the users you will encounter, even if not in the next few months? I did some research and most of what is done is server side, with caches and other similar stuff. Any points in the right direction would be helpful.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
"Even if not in the next few months" smells like premature optimization. Don't do that:
For example, a scalable web application must be able to be hosted on several servers. The last project I've done for my customer was intended to be scalable. There was a choice: either we spend 1.5 months more in order to make the web app work on several servers, or the customer buys a high quality server (one machine only) and the web app is hosted on this machine only. It was much less expensive to buy an expensive server, counting both the direct cost (price of the server vs. price of 1.5 months of work) and the long term savings (power consumption of one high quality server vs. power consumption of several low-end servers). Now the app is running for a few months, and according to the metrics, if there would be a problem with scalability one day, it would concern in first place the database, and in second place the network infrastructure (switches, routers, etc.).
Now, an application may be more or less scalable on several points:
Scalability is very much language agnostic, so there is no PHP specific thing for it. Key factor is to have decoupled subsystems, communicating via language agnostic protocols (so for example if you have to call webservice from your PHP code, don't use PHP's
Worrying about scalability now is probably not worth it: if your project takes off and hits the mark from where you cannot scale by adding more hardware, you'll have enough cash rolling in to fund more thorough measures; if it doesn't, then any effort you make now is a waste of your time and resources.
That said, there are a few things you can and should do to keep your application maintainable, and if you follow these guidelines, factoring in scalability will be much easier later on in the game. An ideal solution will allow you to swap out the entire data storage code with only minimal changes to the program logic and no changes at all to the presentation code.