It is very common to hear that C++ or Java should be used on the "back end" to improve performance. I b开发者_StackOverflow社区elieve 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.
What exactly would you replace "SELECT ..." with? The bigger the database the more you should use SQL on it. If access is slow check that the queries you use are well supported by the indexes.
The rest of your question comes under the heading of subjective and argumentative, but from bitter experience I wouldn't use PHP at all for anything expected to grow beyond a very small initial size.
Sites like facebook are often progressive with often having many re-writes. But yes, they do often run on c++ DLL's and the such. SQL although being string based is quite fast. The thing to keep in mind thought is that there are hundreds of SQL processing software. SQL is a language, not a software.
Yes I agree..there are many DLL's running written on C++..or even cron jobs that updates every second in the server...but i think there are several databases that facebook uses ..depending on your location you will be connected to that server..and after a data is updated an automatically back end script or code will run to synchronize those databases...
精彩评论