The Madness behind the App: WhatsApp and a change of the times

Hisham Hashir
IETE SF MEC
Published in
5 min readJan 24, 2022

Ever since I was small, my family were settled abroad. I vaguely remember my childhood fascination with buying flexie’s (recharge cards) for calling my relatives in India, and I would eagerly scratch away the silver coating with car keys.

It used to be pretty fun, for me. But for my parents, it was a hassle, wasting thousands of rupees just to call back home and keep in touch with their own parents or siblings for a few minutes.

And then, in 2014, WhatsApp came out and the entire game changed.

It’s actually pretty amusing to think that we used to once pay money per text we used to send.

Source: webwise.ie

The Madness

Long back, there used to be a time where network providers used to rule the world. They were the ones who decided whether or not we called back home. They made us pay elaborate rates for international calls and texting facilities until 2014.

They were raking in money, and we were the golden geese.

And then it all changed when WhatsApp came and blew half their revenue sources to dust.

Free texts as long as you have a proper internet connection. Free video calls.

WhatsApp has slowly integrated itself into our daily lives. Without it, there is no texting with friends, no keeping up with relatives and we’ll be socially dead.

The Method

So, the process by which WhatsApp works is actually pretty interesting.

As we all know, WhatsApp is a video chatting, text messaging and voice calling platform owned by Meta. It can be used to talk with individuals or groups.

The core of WhatsApp is its message delivery system on a real time basis which is facilitated by the usage of XMPP (eXtensible Messaging and Presence Protocol).

XMPP works by passing small structured chunks of XML data between two endpoints through intermediate servers.

Put into perspective, if you send a message, it travels to your friend as part of an XML document, travelling to a server before reaching the friend’s phone.

The main reason why the developers went for this was the high reliability and sustainability even under heavy traffic (WhatsApp has about 450 million users roughly).

XMPP helps to store the message in queues, and keep it in the server until the receiver comes online and reconnects with the network. After the message gets delivered, the messages get deleted from the server.

Deleting it from the server helps to maximize resource utility for WhatsApp.

The Language and The Fun

The language WhatsApp is coded with is called ERLANG. It is basically a programming language which is used to build massively scalable soft real-time systems with requirements on high availability.

However, WhatsApp has grown to be far more than just a messaging service. It has grown into a media hub where we share photos and videos with our loved ones.

So how it does it work?

The contents such as audio, images or videos are uploaded to a HTTP server and are linked with the content and sent to the user, sort of as a thumbnail.

This thumbnail can be chosen to be downloaded from the server to the receiver’s phone. This uploaded media is later deleted after a fixed period of time.

WhatsApp also has HTML5 web sockets which facilitates two way communication. The web sockets provide a connection between the web servers and the clients in a way so that both parties can send the data simultaneously.

WhatsApp’s database is managed by Mnesia DB, which is a distributed Data Base Management System which is also the default Data Base of ERLANG.

The operating system used by WhatsApp is FreeBSD. It uses YAWS, an exclusive web server, for storing multimedia files.

The Lock and Key

Everyone has privacy concerns. There was a time when social media was evolving into the security juggernaut it has become now, when hackers had made privacy their plaything.

Therefore, it was only natural that WhatsApp eventually came out with something to combat those privacy concerns.

And one fine day on 2016, they rolled out a new update that read:

“Messages are end to end encrypted. No one outside of this chat, not even WhatsApp can read or listen to them”.

End-to-end encryption is basically intended to prevent data from being read or secretly modified, other than by the true sender and its recipients.

Encryption is essentially a technique of securing digital data using one or more mathematical techniques, along with a key to decrypt the information.

Something very fun to look at in WhatsApp is the way their encryption works.

Suppose I send a message to my friend with, “Hey dude, how are you doing?”

So the message immediately gets scrambled and “locked” using symbols and numbers that don’t make any sense. Sort of like ^%^*(^*()**&*&*878201!

This makes it very hard to open for third party interference and hacking.

So only you and the person you are messaging are able to read what you’ve just sent and make sense of it.

What happens here technically is that, my friend has a public key (which is unique to his/her phone number), so when I text them, their public key encrypts my message.

This message is sent through the server and reaches my friend’s phone.

And my friend’s private key that no one else knows about, decrypts my message.

This is all just a rudimentary explanation of the technology used in WhatsApp, but it’s still very fun to explain and to understand!

Something that we probably do thousands of times in a single day, is a long complicated process that looks so easy- which is genius at its best!

.

.

.

**We also invite science and technology enthusiasts to write for us. If you think you have interesting stuff which the world should know about, send in your articles to us!**

Interested in writing for us? Fill out the form shared below and we will get right back to you!

IETE Writers’ Corner — Google Forms

--

--

Hisham Hashir
IETE SF MEC

I murder English with a pocket pen and bits of crumpled paper.