Monday, April 15, 2013

How can facebook handle so many users in real time with php?

Q. 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.

A. 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.

How do you change your facebook page from the normal facebook to the new one?
Q. I know that Facebook got a new layout for the profile pages. How do you change it so I have the new layout?

A. go here

http://facebook.com/about/timeline

then click the green button at the bottom

you can go here to learn how to set it up

http://abrax.us/Facebook/TimelineChecklist.php

if you dont see the button, that means you have to wait for it

What is the difference between a Facebook "Fan Page" and an ordinary Facebook profile?
Q. Is there really a difference between Facebook Fan pages and ordinary Facebook profiles? I constantly hear about Facebook "fan pages", but there are no references to the "Fan Page" on Facebook's site. However, there is the option to ad a page. Is this considered the "Fan Page" everyone's talking about? But there are several options. Are they all "Fan Pages" ?

A. Profiles represent individuals and must be held under an individual name, while Pages allow an organization, business, celebrity, or band to maintain a professional presence on Facebook. You may only create Facebook Pages to represent real organizations of which you are an authorized representative.

In addition, Pages are managed by admins who have personal Facebook profiles. Pages are not separate Facebook accounts and do not have separate login information from your profile. They are merely different entities on our site, similar to how Groups and Events function. Once you have set up a Page within your profile, you may add other admins to help you manage this Page. People who choose to connect to your Page won't be able to see that you are the Page admin or have any access to your personal account.

Similar to profiles, Pages can be enhanced with applications that help the entity communicate and engage with their audiences, and capture new audiences virally through friend recommendations, News Feed stories, Facebook events, and beyond.




Powered by Yahoo! Answers

No comments:

Post a Comment