Facebook is a juggernaut, a fast-moving, adaptive company that will register its 700 millionth member in the coming months, making it bigger than all but two countries of the world (China and India).
Ensuring its users are able to access the social network quickly and securely, from a range of different devices are among Facebook’s top priorities, but that’s not so easy when your userbase is nearing a billion registered members. To ensure it can scale its operations, remain operational worldwide 24 hours a day and add new features to retain users, Facebook needs to employ some of the top engineering talent.
At a recent briefing at Facebook’s London offices, we were invited to learn about what challenges Facebook’s Engineering Team faces but also what they intend to do with the platform. This piece aims to give a summary of what we learnt.
Mobile
Facebook users are able to access the social network using a variety of different devices, something that it actively encourages. Between its official iPhone and Android applications alone it facilitates the actions of around 67 million users on a daily basis, a considerable combined total for the two most popular smartphone operating systems currently available.
Despite a huge smartphone following, Facebook’s mobile userbase tops 250 million active users. Mobile users are said to be twice as active on Facebook as their non-mobile counterparts, something that Facebook recognises as it constantly adapts its offerings to cater for its mobile audience.
Mobile operating systems handle applications differently. Most require developers to code using its own programming language. Facebook, although it continues to create and update its own applications, ultimately champions open web standards, consistently updating its mobile website to allow any person with a mobile web browser to enjoy some form of Facebook functionality.
Recently, Facebook announced it had moved from building and updating multiple versions of the mobile Facebook (m.facebook.com) for low-end mobile devices and touch devices (touch.facebook.com) to roll out a major upgrade to m.facebook.com to deliver a tailored Facebook experience no matter the device. Now, every mobile device will request the same UI framework based on XHP, Javelin, and WURFL, allowing the engineering teams to build new features once, for every mobile gadget.
When Facebook utilises a technology, it always tries to give it back to the developer community so they are able to create their own applications using code provided by Facebook staff. David Recordon, Senior Open Programs Manager at Facebook, heads the open source and web standards teams at Facebook, creating company-branded technologies to streamline the company’s web operations before opening them up and giving them back to the community.
Having the chance to speak to Recordon at the briefing, it was clear that he was involved in a huge amount of projects. A typical day would involve working with HTML5, CSS and JavaScript technologies, but also working to open-source projects that had gone live on the Facebook website.
Currently Facebook has 50 projects hosted on Github – an online hosting repository for public open-source code – many of them mobile.
Simon Cross, part of the Platform Engineering Team, explained how he was involved in the continued development of JSGamebench, an open framework that allows game developers to benchmark the performance of their HTML5 games. The project took two weeks – and one hackathon (a late night coding session at Facebook’s offices) – to develop, from idea to release.
Site Operations
Facebook maintains it “has been developed from the ground up using open source software” (as discussed above). By doing this, developers are able to build their own applications (many of which you use every day) using the same infrastructure technologies that power Facebook’s website.
Jason Sobel, Engineering Manager at Facebook, explained at the briefing that Facebook’s huge growth in such a short period of time initially meant teams were working to ensure the site remained accessible, firefighting problems as they arose. As Facebook continued to hire some of the brightest talent in the industry, its engineers began to scale its operations, making it reliable enough to handle growth long term.
Even though Facebook utilises Apache, PHP and Memcache, Sobel said that to be able scale and expand Facebook, those technologies alone wouldn’t “fit the paradigm”. With systems now “API aware”, Sobel talked about how Facebook incorporated its own FBObjects and Associations. This would not only allow for the storing of data, it would allow Facebook engineers to connect millions of data strings, to other pieces of data, powering connections millions of relationship statuses and friend lists.
With those systems in place, engineers continue to tune jemalloc and memcached technologies (and others that we don’t know about) to be leaner on memory usage, speeding up Facebook’s own platform and website.
Sobel said that over the past 6 months, a lot of emphasis has been placed on improving site speed, streamling how the website utilises and renders CSS and AJAX and other code. The improvements are visible every time you visit the site; photos are now displayed in a theatre style popup, comments automatically update when they are posted and the pages load in an instant.
Partnerships
Developing a platform is fantastic, but you need to make sure people know about it and want to use it.
We know that Facebook employees are encouraged to engage the developer community, but they also works with companies to educate them on what their products/services could do if they had social built-in from the very beginning. Ranging from websites to electronics manufacturers, Facebook works with businesses to help them incorporate social services without building them from scratch.
The recent announcement of the HTC ChaCha and HTC Salsa smartphones, which were initially touted as being part of Facebook’s first official move into the mobile market, is just one example of how Facebook worked with third-parties to incorporate a Facebook service into another platform.
Facebook regularly holds developer meetups, allowing companies to work with employees to build applications and better understand what tools it offers.
Security
As one of the most popular websites on the planet, Facebook is subjected to intense scrutiny over its security practices.
With the Facebook Like button proliferating around the Internet, giving users the chance to recommend content to their friends, scammers and malware providers have moved in to abuse the system. When asked about what the company does to ensure its users aren’t targeted by clickjacking techniques, its engineers said that its external buttons are constantly updated to render them inaffective on untrusted websites.
The company is also said to be working with browser vendors to eliminate Facebook scams, stopping them at the source. Whilst there are no public announcements of such initiatives, it is suggested there is ongoing dialog with companies including Google, Mozilla and Microsoft.
To protect itself from possible compromise, Facebook employs internal whitehats to continually probe and test the security of its website. Engineers constantly monitor data, keeping an eye on machine crashes and look to see if user trends change, working to push out priority fixes with hours. On a typical day, engineers will push numerous updates each day, submitting feature additions/fixes with varying urgency levels.
All of Facebook’s changes are first tested on an internal “copy” of its website, which are then submitted to Facebook’s “pushers” to merge them into the live site.
Conclusion
I left the briefing feeling I had just scratched the surface on what really goes on behind the scenes at Facebook, the sheer scale its platform is mind-boggling.
It’s interesting to learn that of the 2000 people working at the company, the biggest engineering teams at Facebook are actually quite small, with the recent messages launch incorporating ten engineering employees. In many cases, staff will have dual roles, serving as a bridge between core and operations teams.
If you want to know more about how he company operates, Facebook recently allowed MTV cameras into its offices to provide deeper insight into the company, given the huge press exposure after the launch of The Social Network. You can watch the video clips here.
Get the TNW newsletter
Get the most important tech news in your inbox each week.