Whatsapp is an American freeware, secured cross-platform messaging and Voice over IP(VoIP) app founded by Jan Koum and Brian Acton with its initial release in January 2009 and later in 2014 owned by Facebook. It allows users to send text messages and voice messages, chats, makes audio-video calls, and share media, documents
with individuals or groups.
It is one of the popular messaging apps and you are curious to know what technology stack WhatsApp uses. Then you are in the right place in this article, I will explain Whatsapp's, Technology Stack.
WhatsApp technology Stack
- Facebook Data Center
Php is an open-source, free server-side scripting language built for developing websites and web applications. It stands for "PHP: Hypertext Preprocessor".
XMPP protocol is widely used by Whatsapp for the instant messaging backend. It stands for "Extensible Messaging Presence Protocol".It's a protocol similar to HTTP where the client establishes a connection with the XMPP Server and keeps it open for as long as the client is logged in. Like REST API, it does not close the socket after the socket sends/receives the data is completed. Socket opens connection as long as you are signed in.
XMPP uses TCP/HTTP/Websockets as the transport binding.
In order to handle hundreds of millions of heavy-duty, Whatsapp uses Mnesia. Mnesia is a multi-user distributed DBMS built in Erlang. Mnesia's key benefit is that it "can be held coherently on the disk and in its memory" in the persistence sense. This helps to get quick requests time.
FreeBSD is a free and open-source operating system built on the top of the Unix Operating System. Among many OS of Berkeley Software Distributions(BSD), FreeBSD is one of the most popular OS distributions used to power desktops, modern servers, and embedded platforms. We can take FreeBSD as an excellent performance OS. It is like Linux because it shares many similarities with it. It has better security than Linux.
Yaws(Yet another webserver) is a high-performance multithreaded webserver entirely written in Erlang. generally suited for dynamic content web applications.
It can be used in 2 modes :
1) Standalone Mode: Here, Yaws performs like the regular standalone regular webserver.
2) Embedded Mode: Here, Yaws runs as an embedded webserver in other Erlang-based applications.
Yaws has good performance under high concurrency because Yaws uses Erlang's Lightweight threading system. It can works efficiently with any database.
Facebook Data Center
Whatsapp used to run in IBM SOFTLAYER cloud, an independent cloud hosting company but later shift to Facebook's own Data Center.
Ans: WhatsApp uses Erlang as a backend programming language. Erlang seems to be much agile to adapting for hotfixes and instant updates.
Ans: Yes WhatsApp uses XML layout. It contains 2 XML Layouts respectively for the incoming and outgoing audio messages.
Ans: WhatsApp uses different TCP and UDP ports. Some of the TCP ports used are TCP 40, TCP 443. Some of the UDP ports used are 34784, 50318, etc.
Ans: If the application needs to handle a large number of concurrent messages, if the application needs to be scalable and easily distributable over a network etc then Erlang is one of the suitable choices. But other languages like Php, Java, .Net, nodejs are also good at it. It's their choice.
Ans: A db.crypt12 file is a WhatsApp Messenger database file. The encrypted chat messages history of the users is stored here. WhatsApp uses it to encrypt a user's message on an Android device.