This Forum has been archived there is no more new posts or threads ... use this link to report any abusive content
==> Report abusive content in this page <==
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can facebook handle so many users in real time with php?
11-09-2012, 07:40 PM
Post: #1
How can facebook handle so many users in real time with php?
There are millions of users on Facebook at a time. Despite this, Facebook is able to update people's news feeds with others activity in real time. With what structure of php can this be accomplished.

Ads

Find all posts by this user
Quote this message in a reply
11-09-2012, 07:49 PM
Post: #2
 
Well, to be honest, it's not the PHP code that makes it possible, it's the huge servers they use.

Ads

Find all posts by this user
Quote this message in a reply
11-09-2012, 07:49 PM
Post: #3
 
You can do it with any "structure" of PHP, they just have warehouses filled with servers.
Find all posts by this user
Quote this message in a reply
11-09-2012, 07:49 PM
Post: #4
 
Actually both of the answers above suck.
Look into 'HipHop'
It's a code translator that the Facebook team made that converts the PHP code to C++, allowing them to compile it. Since compiled code runs much faster than interpreted code (except ASP/ASP.NET, which just sucks in general) it allows them to accomplish much faster loading times.
As well, it's not only the code that allows them to do such. You have to consider that they're running constant queries to their databases, thus their queries have to be top-notch. Writing a query well will significantly reduce the amount of time it takes to pull from the database. This includes indexes, proper queries, using prepared statements when need be, and database optimization.

Having a whole databank of servers does NOT make your website run faster. In fact, it adds overhead to the whole process, thus potentially increasing loading times. So there's both answers proven wrong.
What HipHop did for them was significantly reduced the server load and time required to process the code, thus allowing them to process more on one server, and compile their code. The only con of that was losing some commands such as eval().
I personally compile my PHP source and use it as such. You also have to ensure that when you write it, it's properly structured and that the best practices are used. This will also significantly reduce processing time and load.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)