If you were looking at writing scalable, self-healing web application, you could have used Java or Erlang. Also Scala came out 2003. PHP is a really crappy choice for a webapp that needs to scale. PHP doesn't have threads, is synchronous and doesn't perform very well when it comes to CPU heavy tasks. But where it is awesome is whipping up small scripts for websites. That's what it was originally meant for.FB would be the single biggest user of anything they use and would indefinitely but pushing far beyond the limits of any choice they made.
I'm honestly curious what was the significantly better choice back in 04-05? I know some of the other choices, but what was so far beyond their choice that makes their choice silly?
The choice of language greatly influences the architecture of a program.
And for the database. Well the choice to put graph data to MySQL was a really, really dumb one. You can do it and it will work but you will later on pay for that decision with having to buy beefy servers because your queries has a lot of JOINs and UNIONs. Just the basic edge finding in social graph with MySQL is very expensive operation. MySQL is great for transactions that are well-defined and always need to be guaranteed to be processed, like for example financial data. I don't remember on top of my head which graph databases were available back then but the truth is that not very many compared to nowadays. Graph database is not an new idea so there still must have been some choices.
I think that Suckerberg chose the most popular stack, kinda like choosing Apache nowadays and went with that. Frankly, in Facebook's case it doesn't matter. They were able to overcome it BUT these kind of decisions and lack of knowledge can break a company. I have witnessed one aspiring analytics company go down because they designed their product with PHP & MySQL.. Sounds a working plan until you get your first BIG customer pumping up so much data that your MySQL server can't take it. Now you need to be able to scale your system but the problem with MySQL is that it scales only up meaning that you need a bigger, more expensive server and it wasn't meant for writing data, it was designed to provide fast queries. Now what happened when this analytics company realized this? They didn't have the capital to write everything all over again so they had to radically change their business plan and at least for the while, dump their visions of getting rich.
Every time you use FB as an example, remember that it is a unique company in many ways. They got incredibly lucky in with Suckerberg's gambles and in many cases they just happened to be able to get the right person to fix the platform. Now imagine all the companies that made the same choices and didn't get so lucky...
Dislike ads? Remove them and support the forum:
Subscribe to Fastlane Insiders.