Technology Used in WHATSAPP | WHATSAPP Technology Stack


👤 Diwas Poudel    🕒 May 28 2022    📁 Fix    📜 0 comment

Whatsapp is an American freeware, secured cross-platform messaging and Voice over IP (VoIP) program that was initially released in January 2009 and was later acquired by Facebook in 2014. It was founded by Jan Koum and Brian Acton. Users are able to send text messages, and voice messages, participate in conversations, make audio-video calls, and exchange documents, media, and other files with other users, either individually or in groups.

You are interested in learning more about the technology stack that Whatsapp employs because it is one of the most popular messaging apps. Then you have come to the correct spot because, in the upcoming sections, I will describe the technology stack that WhatsApp uses.

WhatsApp technology Stack

  • Erlang
  • Php
  • XMPP
  • Mnesia
  • Facebook Data Center
  • lighttpd
  • FreeBSD
  • Yaws
  • Ejabberd 

Erlang

Many of us do not know Erlang. I have never heard this language before. Erlang is a general-purpose, concurrent programming language like Java, C#, C++, Javascript, Python, etc., and runtime system designed by Ericsson Computer Sciences Lab for developing robust scalable soft real-time systems of programs. Erlang is used on the server-side in WhatsApp.It has built-in support for concurrency, distribution, automatic crash recovery.Message passing(IPC) is core featuers of Erlang.

PHP

Php is an open-source, free server-side scripting language built for developing websites and web applications. It stands for "PHP: Hypertext Preprocessor".

Also Read: Google Technology Stack

XMPP

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.

Ejabberd 

ejabberd is an application server and an MQTT broker that is primarily built in the Erlang computer language. It is based on the XMPP protocol. It is compatible with a variety of operating systems that are based on the Unix kernel, including macOS, Linux, FreeBSD, NetBSD, OpenBSD, and OpenSolaris.

Ejabberd has a number of useful features, some of the most significant of which are one-on-one chatting, group chat, storing and forwarding offline messages, contact list and presence, and so on.

MNESIA

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 request time.

Because WhatsApp has a huge volume of call setups, it is almost hard for these data to be written to the disc. Mnesia assists with this challenge because of the volume of traffic WhatsApp generates. Mnesia is defined by the fact that it "may be coherently preserved on disc and in the main memory," in terms of its persistence. This assists in achieving faster response times to requests.

Also read: WhatsApp Database Folder | Can I delete msgstore crypt files?

FreeBSD

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.

Also Read: Microsoft Technology Stack

Yaws

Yaws(Yet another webserver) is a high-performance multithreaded web server 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 work 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.

Also Read: How to upload/send high-quality photos, videos on WhatsApp?

FAQ

What technology does WhatsApp use for free calls?

Ans: The VoIP service, also known as Voice over Internet Protocol, is what makes the Whatsapp Internet Calling function possible.

Everything you say is first turned into a series of packets, then sent to the recipient by way of a server, and is only put back together after it arrives at its destination. It's very much the same as sending an email or a message.

What is the backend for WhatsApp?

Ans: WhatsApp uses Erlang as a backend programming language. Erlang seems to be much more agile in adapting for hotfixes and instant updates.

Does WhatsApp use XML?

Ans: Yes WhatsApp uses an XML layout. It contains 2 XML Layouts respectively for the incoming and outgoing audio messages.

Does WhatsApp use TCP or UDP?

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.

Why does WhatsApp use Erlang?

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.

What is db. crypt12 file in Whatsapp?

Ans: A db.crypt12 file is a WhatsApp Messenger database file. The encrypted chat message history of the users is stored here. WhatsApp uses it to encrypt a user's message on an Android device.