It is very common to hear that C++ or Java should be used on the “back end” to improve performance. I believe sites like Facebook have C++ based “services” for critical performance.
For example: Is it at any time more cost effective to replace SQL “SELECT * FROM ….” type commands passed via PHP with something else because the database is a huge one to search through?
In general can someone explain by examples what kinds of things one should probably not be using PHP for even at the early stages of a site.
I am not web developer, and I am also not PHP programmer and this question is more discussion so let me try.
On this super big type of sites you need smart and efficient algorithms, not efficient languages. Lot of Google code running their website is written in Python, which have same speed compared whit PHP.
I think that database need to be constructed in way, that it returns as least amount of data as possible, that it require as least as possible number of queries and that returned data need as least as possible processing for displaying. It same goes whit insert.
If you manage to design such page in such way, your page will not be processor exhaustive and will mean that it will not matter which language you will use.
You also do not need booletproof type of database like you would use for running bank (100% transation complition, database locking, … ) so you can balance reliability whit speed. But for this you need specal database.