As of February, 2017 WhatsApp crossed 1.2 billion users globally. Ever wondered how a team of just 55 engineers at WhatsApp is able to manage a billion of users?
A simple answer -> Erlang
Erlang is a functional language paradigm which is used for complete backend stack of WhatsApp. WhatsApp basically uses ejabberd XMPP Application server for backend implementation of WhatsApp messenger which is a open source project developed in Erlang.
Now what is so special about Erlang or the implementation of ejabberd server? Also, Going to little bit deeper, there is a huge difference the way processes are created in Erlang and other languages and that is the reason processes in Erlang are so light weight.
- Massively scalable : It has massive concurrency, can handle upto 2, 000, 000 users on one node
- Fault tolerant : In a real-time system, we know that errors will occur and things will break and so do the erlang engineers. To prevent this, Erlang has strong tools to minimize the errors and recover from them as early as possible.
- OS created processes: Erlang processes (known as green threads) are created by Erlang VM, instead of OS
- Context switching: Switching between processes, one process knows the Pid of process it switches to, so there is no role of scheduler to play, hence making it O(1) operation.
- Process Isolation: Processes are completely isolated due to which there is no need to implement mutexes so as to prevent deadlock situations.
The scalability mentioned above is gained in a way Erlang system creates processes.
The following properties of Erlang processes helps it achieving such high scalability :
- They are lightweight (grow and shrink dynamically)
- They are fast to create and destroy
- The scheduling overhead is very low
- There is no shared space between processes, and the only way they can communicate is through message passing
You can expand the idea in this way – The Erlang VM is operated by one OS process, and Erlang VM can create as many processes as per need, so one OS process is controlling many Erlang processes, that’s why there is no overhead on Operating System and everything is taken care of by Erlang Virtual Machine.
Since you require very less number of systems to handle billion of users, so you need less number of engineers.
This article is contributed by Mandeep Singh. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Top 5 PSUs for Computer Science Engineers in India
- How I got selected for the TalentSprint Women Engineers (WE) Program powered by Google?
- How to Manage Web Development Projects?
- How Did Facebook Remove 2.2 Billion Fake Accounts in the First Quarter of 2019?
- Android Launcher Apps Users Must Watch
- Common Sense tips for Mobile Security for End Users
- Top 10 Machine Learning Project Ideas That You Can Implement
- Top 5 Golang Frameworks in 2020
- How to Learn Python in 21 Days?
- Top 5 Cloud Platform Service Providers in 2020
- Subscriber Identity Module (SIM)
- 10 Web Development and Web Design Facts That You Should Know
- 5 Online Education Etiquette That You Must Know in 2020