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.
Related Items
- How many people can see a facebook page?
I want to get a facebook, but I'd like to be sure: if potential employers can access someones facebook, can everyone? How safe is it? ... - How many calories should i eat to lose weight quickly?
I am 5 ft and weigh 115-116 pounds (8.3/4 stone), i have always wanted to be thin and i have just had enough of my weight i can't stop thinking about ... - Can banks tell how many times an online bank account has been accessed and the times?
Someone has formed a username and password to watch bank transactions for a few years now, can the banks track each time the account has been entered?... - How many calories should i eat a day in order to lose some weight?
How many calories a day should i eat to lose weight. I will do little work out, and i am not expecting to lose a tremendous amount of weight in a cert... - How many times a day should I make a trade when trading forex?
I am going to turn 18 tomorrow and I've had a practice account for several months and have been experimenting with it all that time, trying different ... - What docs does my accountant need for rental real estate at tax time?
It will be my first time claiming my home as rental real estate when I do my 2009 taxes. I will be using Schedule E. I know I need to bring records ... - How many internal organs could you remove from a healthy human before they died?
Imagine we have a healthy, adult human on an operating table sedated just enough to nullify the pain, and surgeons set about removing the subject's in... - How many portions of food and drink do you have to have to maintain a healthy diet?
Hi I've been wanting to diet for a long time but I'm not really sure how many portions of each catagory of food I should have a day.I need help. Becau... - How many months can be left on a passport so you can travel to Holland?
I am looking to travel to Holland in March 2009. My passport expires in October 2009. Can anyone tell me if I have sufficient time on my passport ... - need to loose 18 pounds in 2 months, any ideas how i can do this in the limited time period ???
i am a 13 year old girl, i am 5.3 ft tall and weigh 119 pounds, i need to shed 18 pounds in 2 months, please don't suggest me to buy e books or to get... - About how many minutes daily should I jump/jog on my mini trampoline to loose this weight? (more info inside)?
Im 16,I weigh 122 I need to weigh 103 Im 5 4 ( no comments on the goal weight..ITs very reasonable..Im small frame) Anywhoo Im eating 90% healthy fo... - How many laxatives should i take to lose weight? & why is this not working..?
Was just wondering how offten & how many laxatives you should take to loose weight..? please dont bother with the "its not good for you" speeches beca... - Dr. Atkins Diabetes Revolution- Does anyone here use it to treat their diabetes? (no put downs,need real info)
My dr. oked for me to use the Dr. Atkins Diabetes Revolution diet to loose weight and control my diabetes. She said she's used it successfully in her ... - DIET PILL USER’S: what works?
I'm not looking to get spammed or lectured. I've tried every healthy way to lose weight and not a single pound has come off in the past year. Exercis... - Please help me.How can i loose weight?ive been trying so many methods but in vain.?
ive tried going to jogging each day ,eating less and not too late but i still got the problem of weight loss.Please help me if you know other method t...
November 5th, 2010 at 1:24 pm
Well, to be honest, it’s not the PHP code that makes it possible, it’s the huge servers they use.
November 5th, 2010 at 1:28 pm
You can do it with any “structure” of PHP, they just have warehouses filled with servers.
November 5th, 2010 at 2:11 pm
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.