void life ()
{
Wake up- find you cell phone, unlock it-go to facebook.
Got to work or school- on a public vehicle? Fiddle with your phone and go to facebook again.
Lunch break – I’ve got to check facebook!
End-of-school or work- I wonder what’s happening on faceboook…
Watch television- a commercial? I’d rather stare at my newsfeed.
Start studying or working – shall I have a last peek at facebook?
Night- Go to bed and get tucked in. Find your phone to set up an alarm. But after you set up the alarm- hmmmmmmm let me check my facebook!
}
This lifestyle and the feeling is mutual to most of us.
Let’s start with the fact that only 2.2 percentage of whole population of Nepal have access to internet and among them, 0.85 million people use Facebook. Since you are on this site, this makes you among one of the 2.2 percentage who use the Internet and if you are reading this article then you are most probably a facebookie too.
How Facebook Works in Spotlight?
Facebook utilizes lots of services and programming languages to work. To be precise, Facebook servers use LAMP with Memcache. Basically, LAMP stands for Linux, Apache, MySQL and PHP.
Linux & Apache:
If you have seen the black Penguin logo on WWW then you certainly know Linux. Well, its an open-source UNIX-like kernel for ‘Operating Systems’ and the reasons why Facebook uses it are:
- Because of its high security and its ease of customization according to needs.
- Apache is considered as the best and most popular HTTP server – no wonder Facebook uses Apache.
MySQL :- We know that Facebook works using Linux OS and Apache servers. What about the database where huge amounts of data, including the Facebookies personal data, is stored? This is where MySQL makes entry because its reliable and speedy as well. MySQL basically stores key values since data is stored randomly among huge number of logical instances.
PHP :- PHP is a great programming language – a scripting language. Facebook uses this language specifically because this language has a good programmer’s community and this language also has a great support as well.
Memcache :- Basically, Memcache is an open-source system for caching memory. All it does is make dynamic sites like Facebook work faster by allowing them to cache data in RAM instead of going all the way to database.
Problems with ‘LAMP’ System
Facebook has come across many problems due to this LAMP system – maybe Facebook has grown just amazingly fast… Among many problems, a major problem is that PHP is difficult to configure for big websites; it may not be optimized for big websites. Moreover it’s the fastest executing-language out there.
Since the dynamic growth of Facebook, it is facing many problems like memory caching, data storage and most importantly it’s database is very complex and to cover-up that backstage with another curtain, Facebook has started some back-end and open-source projects.
How Facebook Works behind the Curtains?
How Facebook works behind the curtains is pretty simple – they create any program or service when they need it and create a framework to make creation of services hassle-free.. Facebook back stage services are mostly written in languages like Java, Python, Erlang and C . A list of all open-source projects can be found in the facebook developers website. .. Moreover, here are some of important open-source projects:
Apache Cassandra (Database):- Cassandra is a storage system designed to manage huge amounts of data without a single point of failure. ‘Facebook inbox search’ works using Cassandra as well.
Thrift (Protocol) :- Thrift gives the framework for development in cross-language services. Many languages like Java, Ruby, PHP, C and python are supported by thrift.
Scribe (log server):- Scribe is a server for aggregating log data streamed in real-time from many other servers. It is a scalable framework useful for logging a wide array of data. It is built on top of Thrift.
HipHop for PHP:- Basic use of this framework was to transform PHP to highly optimized C , in result this framework caused large performance gain for Facebook servers.
All this basically answers ‘How Facebook works’ so now, you not only know what’s on your newsfeed but also what’s behind it. It doesn’t hurt to be informative about a place you spend your entire day at.