The Facebook Blog
The PHP programming language has solidified itself as the language of choice for many top internet properties, including Facebook. PHP is easy to use and integrates well with Apache, Memcache, and MySQL. Despite its suitability for web development and scripting, PHP is generally not the best choice for standalone software or servers. C++, on the other hand, is well suited for building both online and offline services.
Unfortunately, if the new services operates with data managed by the existing PHP code base it can be dangerous to use a separate data access pattern. If the cache keys or database schema were to change in the PHP code base then the service would be broken (and potentially corrupting data for the PHP code base) until the code was updated and the program recompiled and restarted.
Faced with this problem we decided to embed the PHP Interpreter into C++ binaries. This isn't a novel endeavor by any means; Apache uses the PHP Server API (SAPI) to accomplish exactly that. However, when we began attempting integration of our own we found that the SAPI required quite a bit of expertise to manipulate effectively.
In order to make embedding PHP truly simple for all of our developers we developed the PHPEmbed library which is just a more accessible and simplified API built on top of the PHP SAPI. The library is so useful, we decided to share it with the world. Check it out for yourself at http://developers.facebook .com/phpembed/
Boz is a software engineer at Facebook and, like PHPEmbed, he is open source
Unfortunately, if the new services operates with data managed by the existing PHP code base it can be dangerous to use a separate data access pattern. If the cache keys or database schema were to change in the PHP code base then the service would be broken (and potentially corrupting data for the PHP code base) until the code was updated and the program recompiled and restarted.
Faced with this problem we decided to embed the PHP Interpreter into C++ binaries. This isn't a novel endeavor by any means; Apache uses the PHP Server API (SAPI) to accomplish exactly that. However, when we began attempting integration of our own we found that the SAPI required quite a bit of expertise to manipulate effectively.
In order to make embedding PHP truly simple for all of our developers we developed the PHPEmbed library which is just a more accessible and simplified API built on top of the PHP SAPI. The library is so useful, we decided to share it with the world. Check it out for yourself at http://developers.facebook
Boz is a software engineer at Facebook and, like PHPEmbed, he is open source
News Feed may not walk around downtown Palo Alto on awesome hydraulic legs handing out customized stories to people on the street (yet) but it _is_ a robot. While we sleep it stays up sifting through the enormous volumes of information about our friends on Facebook and picks just the best pieces to show us. While we eat it is keeping track of whom we seem to be keeping an eye on recently as well as remembering whom we have cared about in the past. It is very discreet and never talks about this secret information to other people or systems, it just needs the information to do a better job picking stories because it thrives on people finding its stories useful and entertaining.
Let's walk through what News Feed does when it is publishing stories for me. First, it gets a list of all my friends and acquaintances on Facebook and considers how often I interact with them. Then, with full respect for all privacy settings, it gets a list of all the things my friends have done on the site since it last checked. It also looks up all the stories it could have published the previous week in case one of them needs to be updated. After looking at all that information and considering my News Feed Preferences, it picks just the few stories that are good enough for publication and puts the rest in a safe place until it gets back to me again. It does all of this for me in 0.00023 seconds.
That may not sound impressive at first, but let's look at more numbers. It takes less than an hour for News Feed to publish stories for every user on Facebook. With 17 million users on Facebook there are over 2 billion friend connections and over 5 billion actions taken every hour. That means News Feed is processing 1.4 million new user actions and 12 million previously unpublished stories every second to find just the best 13,000 stories to give our users or the top 0.1% of all possible stories.
News Feed is also growing faster and smarter all the time. It has gone from processing an average of 100 MB of data each second when we launched to over 300 MB/s now (that's like listening to 100 mp3s a second!). In fact, News Feed has been so successful it has even been getting involved with real estate; it started out in a 19 server apartment, has now signed the lease on a 109 machine house in the suburbs, and already has plans for expansion.
When we built News Feed, we thought we were building a pretty cool and innovative customized news aggregator. It turned out we built a friend who knows us so well it can show us stories we didn't even know we wanted to see. Stay tuned to your Home pages (and here in the blog) for improvements as new stories begin to bring together more data and we build systems to let News Feed get an even better idea what kind of stories you like.
Boz is a software engineer at Facebook. He doesn't anthropomorphize everything, just News Feed. Which is a robot.
Let's walk through what News Feed does when it is publishing stories for me. First, it gets a list of all my friends and acquaintances on Facebook and considers how often I interact with them. Then, with full respect for all privacy settings, it gets a list of all the things my friends have done on the site since it last checked. It also looks up all the stories it could have published the previous week in case one of them needs to be updated. After looking at all that information and considering my News Feed Preferences, it picks just the few stories that are good enough for publication and puts the rest in a safe place until it gets back to me again. It does all of this for me in 0.00023 seconds.
That may not sound impressive at first, but let's look at more numbers. It takes less than an hour for News Feed to publish stories for every user on Facebook. With 17 million users on Facebook there are over 2 billion friend connections and over 5 billion actions taken every hour. That means News Feed is processing 1.4 million new user actions and 12 million previously unpublished stories every second to find just the best 13,000 stories to give our users or the top 0.1% of all possible stories.
News Feed is also growing faster and smarter all the time. It has gone from processing an average of 100 MB of data each second when we launched to over 300 MB/s now (that's like listening to 100 mp3s a second!). In fact, News Feed has been so successful it has even been getting involved with real estate; it started out in a 19 server apartment, has now signed the lease on a 109 machine house in the suburbs, and already has plans for expansion.
When we built News Feed, we thought we were building a pretty cool and innovative customized news aggregator. It turned out we built a friend who knows us so well it can show us stories we didn't even know we wanted to see. Stay tuned to your Home pages (and here in the blog) for improvements as new stories begin to bring together more data and we build systems to let News Feed get an even better idea what kind of stories you like.
Boz is a software engineer at Facebook. He doesn't anthropomorphize everything, just News Feed. Which is a robot.
Publicações Arquivadas por Data
2009
Novembro (12)
Outubro (17)
Setembro (10)
Agosto (10)
Julho (10)
Junho (13)
Maio (13)
Abril (13)
Março (14)
Fevereiro (13)
Janeiro (8)
2008
Dezembro (15)
Novembro (14)
Outubro (12)
Setembro (9)
Agosto (2)
Julho (3)
Junho (6)
Maio (5)
Abril (6)
Março (2)
Fevereiro (4)
Janeiro (3)
2007
Dezembro (4)
Novembro (4)
Outubro (1)
Setembro (3)
Agosto (4)
Julho (4)
Junho (2)
Maio (5)
Abril (9)
Março (8)
Fevereiro (7)
Janeiro (4)
2006
Dezembro (3)
Novembro (6)
Outubro (5)
Setembro (7)
Agosto (4)
Archived Posts by Blogger
Abraham Cooper (1)
Adam Conner (4)
Adam Hupp (1)
Aditya Agarwal (2)
Akhil Wable (1)
Alex Moskalyuk (1)
Alexandre Roche (3)
Alok Menghrajani (1)
Annie Ta (2)
Ari Steinberg (2)
Arjun Banker (1)
Austin Haugen (1)
Barbara Fischkin (1)
Barry Schnitt (1)
Benjamin Ling (1)
Bikash Agarwalla (1)
Blair Heuer (1)
Blaise DiPersia (1)
Blake Chandlee (1)
Bo Hong Deng (1)
Bob Trahan (2)
Brian Shire (1)
Brynn Shepherd (1)
Cameron Marlow (1)
Carl R. Augusto (1)
Carolyn Abram (11)
Cat Lee (3)
Chad Little (2)
Chengos Lim (1)
Chris Cox (2)
Chris Hughes (2)
Chris Kelly (4)
Chris Putnam (3)
Chris Ward (1)
Craig Donato (1)
Dan Rose (1)
Daniel Chai (1)
Danna Gutman (1)
Dave Fetterman (1)
Dave Morin (1)
Doug Beaver (2)
Dustin Moskovitz (1)
Elizabeth Linder (2)
Elliot Schrage (2)
Eric Kwan (1)
Eric Zamore (1)
Evan Priestley (1)
Everett Katigbak (1)
Ezra Callahan (8)
Florin Ratiu (1)
Gareth Davis (1)
Gene Fant (1)
Ghassan Haddad (1)
Gibson Biddle (1)
Graeme Menzies (1)
Harry Huai Wang (4)
Henri Moissinac (1)
Jack Lindamood (1)
Jake Brill (1)
James Wang (2)
Jared Cohen (1)
Jason Min (1)
Jason Sobel (1)
Jeff Kanter (1)
Jeff Williams (1)
Jeffrey Wieland (1)
Jesse Dwyer (1)
Jessica Ghastin (1)
Jimmy Lavoie (1)
Joanna Lee (1)
Joe Green (1)
Joe Hewitt (3)
Joe Sullivan (1)
Joel Seligstein (1)
Jon Fougner (2)
Jon Warman (2)
Jonathan Hsu (1)
Josh Elman (1)
Josh Wiseman (2)
Julie Trescott (1)
Julie Zhuo (2)
Justin Bishop (1)
Justin Mitchell (1)
KC Estenson (1)
Kari Lee (1)
Kate Losse (3)
Kathy H. Chan (4)
Katie Carter (2)
Katie Geminder (6)
Kevin Arata (1)
Kevin Der (1)
Leah Pearlman (5)
Lee Byron (1)
Lisa P. Jackson (1)
Liz Perle (1)
Luke Shepard (1)
Makinde Adeagbo (1)
Malorie Lucich (1)
Marcia Velencia (1)
Mark Kinsey (2)
Mark Slee (9)
Mark Zuckerberg (18)
Matt Cahill (1)
Max Kelly (3)
Melissa Luu-Van (1)
Melody Quintana (1)
Michael B Kaiser (1)
Michael Gummelt (1)
Michael Richter (1)
Mike Honda (1)
Naomi Gleit (4)
Natalie Minor (1)
Navid Mansourian (1)
Nico Vera (3)
Nikki M. Flatley (1)
Paul C. Jeffries (1)
Paul Janzer (1)
Paul McDonald (1)
Pedram Keyani (1)
Pete Bratach (1)
Peter X. Deng (2)
Philip Fung (3)
Prashant Malik (1)
Randi Zuckerberg (5)
Raylene Yung (1)
Richard Allan (1)
Rob Goodlatte (1)
Robert Johnson (1)
Roddy Lindsay (2)
Ruchi Sanghvi (1)
Ryan McGeehan (3)
Sam O'Rourke (1)
Sameer Moidu (1)
Sandra Liu Huang (1)
Sara Lannin (3)
Sasha Rosse (1)
Scott Marlette (1)
Scott Mills (1)
Shaun King (1)
Shervin Pishevar (1)
Sheryl Sandberg (1)
Simon Axten (3)
Sophia Huang (1)
Steven Grimm (1)
Suzie White (1)
Ted Ullyot (1)
Teddy Underwood (1)
Tim Sparapani (1)
Tom Occhino (1)
Tom Whitnah (4)
Victor Valdez (1)
Wayne Chang (3)
Will Chen (3)
Xenia Nosov (1)
Yair Landau (1)
Yishan Wong (1)

