Contus Vplay - Intelligent Video Solution to Stream Your Videos to Millions of ViewersCheck it out

How WhatsApp works and how to build a WhatsApp clone?

WhatsApp is the most sought after messaging application that has revolutionized the messaging app market. Several attempts have been made in vain to clone WhatsApp as a chat app, but none of them yielded the result. Despite introducing similar functionalities, no chat app has ever been able to topple WhatsApp’s supremacy as a chat app.

In order to build a WhatsApp like chat application, one should have a detailed understanding of its functioning mechanism and technicalities.

How Whatsapp Messaging App is Working Technically?

create a clone app similar to whatsappWhatsApp uses Ejabberd (XMPP) server which facilitates instant message transfer between two or many users on a real-time basis. High reliability and sustainability even under peak traffic the reason why WhatsApp developers chose Ejabberd above anything else.

ERLANG is the programming language used to code WhatsApp. Code restructuring and some important changes were made to the Ejabberd server to achieve optimal server performance.

Further, Erlang is agile to adapting to instant updates and hot fixes. This is what helps WhatsApp to quickly push the changes to live implementation without requiring restarts.

1. Insights on data transfer in WhatsApp

how whatsapp works technicallyWhatsApp manages over 50 billion messages a day. The key to smooth data processing lies with the message queue length. The length of the message queue of all the processes associated with a node is monitored.

In case of multimedia messages, contents (audio, video, or image) are uploaded into a HTTP server and are linked with the content and then sent to the receiving node (receiver) in the form of a thumbnail. Based on the user’s preference the content can either be viewed or discarded.


2. Protocol used by WhatsApp

The primary protocol in use is XMPP (Extensible Messaging and Presence Protocol).DSL ensures network security and also helps in preventing private data transfer.

As and when message is sent, it is queued on the server. The message waits in the queue until the recipient reconnects to receive the message. As and when a message is delivered the sender gets notified by a double check mark near the message. After the delivery the messages are instantly deleted from the server memory.

This instant deletion from server memory helps WhatsApp keep its resources to a bare minimum.

Additionally, Whatsapp uses HTML5 WebSockets which communication technology which facilitates two-way communication.

3. Registration process of WhatsApp

Whatsapp Registration ProcessUsers can register for WhatsApp by entering their mobile number. On entering the number, the user will be sent a OTP which once verified by the device will initiate the user to the chat screen.

4. Database management

Mnesia DB handles the heavy-duty task of database management. Mnesia is a multiuser distributed DBMS which also happens to be the default DB of ERLANG. Mnesia helps achieve quicker request responses, thereby improving the overall efficiency.

FreeBSD is the OS upon which WhatsApp is built. Improvising on the ERLANG based applications and optimizing FreeBSD, WhatsApp is able to achieve better performance. For storing multimedia files, the app uses an exclusive web server YAWS.

5. End-to-end encryption

Whatsapp’s end-to-end encryption ensures rocks-solid for safety of text & multimedia content. When you send messages, you phone does the encryption and send it to Whatsapp server. The server gets the replies from the receiver’s end, encrypts it and sends to your smartphone. Now, your phone decrypts the messages and displays it.

6. Audio & Video Calls

Whatsapp video audio call

WhatsApp uses highly equipped headway technology rather than WebRTC. The Opus/SILK audio codec 16khz with 20 kbps bitrate and NAT (Network Address Translation) techniques are used to enable audio calling. The STUN server and Peer to Peer connection are the key elements included to boost and maintain authentication to the users.

7. Location Sharing

WhatsApp integrates Google Maps Android API and Google Places API. This API is used for location sharing among the users. WhatsApp is enhanced according to their multiple needs.

8. Payment Module

UPI – Unified Payment Interface is one of the payment modules which is more secure, user-friendly and allows instant payment.

VPA – Virtual Payment Address will use the email address which is registered in the particular bank account that can be shared publicly instead of a bank account number and IFSC code.

MPIN – Mobile banking Personal Identification Number is a 4-6 digit security code used to authenticate all types of money transferred via UPI

Catch a Similar App like WhatsappRequest a Demo


Build a Whatsapp like Messaging App with Contus Fly

Having discussed the technicalities of WhatsApp it is time to shift gears over analyzing the possibilities of creating a whatsApp alternative. There are plenty of messaging applications in the market that appear to be perfect WhatsApp clones. The reality is many of the attempts of building WhatsApp like apps are failing because they do not follow the technical aspects.

Well, if we take such apps as an example, it might be quite difficult to understand as they are completely built products. Instead a ready made solution that can help in creating a WhatsApp clone app would be a better learning material.

Contus Fly is a framework that catalyses the build of an instant messaging application. Contus Fly can be used to develop WhatsApp clone app for Android, iOS and Windows platforms as it has the SDK ready for these widely preferred mobile operating systems. Since native coding has been used by Contus Fly to achieve better speed, it can be handy in developing a WhatsApp like native app.

Framework & Architecture of Contus Fly

contus fly real time chat app work flow


Ejabberd, the open source Jabber server has been customized by Contus Fly to improve operational efficiency. The XMPP protocol has also been customized to speedup signing in and re-signing in sessions. To protect the app from DDOS attacks and to prevent account spoofing, this mobile chat application has been encrypted with HMAC.

Mnesia and MySQL

For data storing, Contus Fly makes use of both Mnesia and MySQL. While Mnesia is used to maintain user login sessions, MySQL contributes in maintaining the user details, right from account credentials to other personal data.

Cassandra database

Chat logs are a key for instant messaging applications. In order to save chat history between several nodes, Contus Fly has deployed . This database offers a good read write speed thus helping users to retrieve chat logs as and when they need.

Amazon S3 bucket

Multimedia messages including audio, image, video are saved in Amazon S3 bucket. Registration for the app usage can be done in multiple ways including mobile number, email, user name password and social login.

As and when a user triggers a message, the chat app SDK sends a request to the Ejabbered server. In return the server checks for the availability of the recipient and if available, the delivery request is sent to the recipients SDK and then delivered. If the recipient is offline, the data is stored in the Ejabbered as message will be queued in the server.

Contus Fly Features

  • Group Chat
  • Offline Messages
  • Push Notifications
  • Presence
  • Social Integrations
  • Locations
  • Sync and Store
  • Voice Calling
  • Video Calling Integration
  • Multimedia Sharing
  • Easy Screen Sharing
  • Fully Searchable
  • Secure
  • Support

Contus Fly – A Premium Solution to Create Real Time Chat & IM Apps

  • 100% Customizable Solutions
  • Multi Platforms Supports
  • Authenticates using Social Networks


How much does it cost to build mobile chat app like whatsapp?

“Cost of making an app like whatsapp” is a very broad term to estimate the cost of it. So how much does it actually cost to build an app like whatsapp? While messaging apps can either be built from scratch or be developed upon a source code, every individual message app being designed might cost a different price accordingly.

Some want it monetized, while others don’t. The instant messaging apps created with the motive to be monetized demands to be studded with a bunch of additional features such as Voice Over IP (VOIP) technology, user customizing options, chat security and a fancy figured fund for maintenance. In-app messaging services call for a different set of requirements to meet its needs, thus costing in different terms.

The number of users the app anticipates to have plays a major role in determining the server load. ejabberd is the most commonly used application server storing its database in Mnesia DB. Whatsapp like native apps has a lot of possibilities to outflow the number of users that could be banked by Mnesia DB. Such additional data requires to be stored in outsourced cloud storage like Amazon cloud services.

Leave a Reply

135 Comments on "How WhatsApp works and how to build a WhatsApp clone?"

22 days 23 hours ago

Hi Ramanthan, i have one doubt.. if whatspp is not storing text messages in their server after it is sent..then how the cyber cell monitors the unwanted messages in whatsapp??
Can u pls explain it technically.?

Emely Linton
1 month 18 days ago

Do you have any expertise in building a real time chat app before this clone app?

2 months 11 days ago

I want to create an app like whatsapp where I want to include peer-to-peer voice calling feature. Is that possible using your solution?

Dan McKinley
2 months 23 days ago

What will be the market cost for developing a whatsapp clone?

Vinoth Paulraj
2 months 25 days ago

Hi Ramanathan,

Its Really amazing article for people like us. I’ve a doubt , can we clone the whats app with different configurations like language will be Java , server will be Apache Tomcat or Jboss ? Because you defined each and every technologies for improving the performance of whats app so changing the technologies will give impact on the application ?

3 months 23 days ago

What Is price for white label chat app like whatsapp

3 months 28 days ago

Why Erlang was chosen for WatsApp?? If instead at server side the implementation was in C++ then how will you rate the performance and hardware usage/requirements for Erlang vs C++ ??

Binu Madhav
4 months 10 days ago

I didnt understand your business model, I have few questions:
1. Is it like this, we give a requirement, you make the modification for the clone, and host it, we pay monthly?
2. Will you provide the source code?
3. Who will manage the security issues like hacking threats?
4. Can we brand it in our name? Can we host the app in platforms like PlayStore in our name?
Sorry, I am new to it, so these questions.
Thanks in advance.

4 months 8 days ago

Hi Binu,
1) It is a one-time payment.
2) If you want to develop the chat app for your business, We will provide full access to source code.
3) After the development, we provide the technical support as long as you need!
4) Yeah, It’s Whitelabel Solution.

4 months 14 days ago

Hi: do you know if group data (name of the group and members) are stored in the whatsapp servers? Or are also a app-side?

4 months 22 days ago

I wanted to develop a chat application exclusively for my corporate purpose. Can you customize and give the required features for internal office communication?

5 months 17 days ago

Hi Ramanathan, how does one create settings similar to those on WhatsApp where one can change their account name and mobile no?

8 months 13 days ago

Hi Ramanathan, We know that WhatsApp is a modern day mailing system, with phone number / OTP and an encrypted code acting as the recipient mail id. What happens if I uninstall WhatsApp and install and register again with
1. Original number …. Can I see / get back all my old messages / conversations?
2. Install with a different (known / friend’s) number.
If the friend’s number also uninstalls WhatsApp, will there be a clash? CAn I get to see friend’s old conversations / messages?

David Augustus
6 months 9 days ago

Hello. Of course not, because its not stored on server, as e-mail service used to do. (Use to do.). You can receive the messages, received after the registration proccess. But i think only one mobile phone number can be logged on account. There also is another permisions level for its accounts, if you activate it, need to re authenticate to use that phone number. If you reinstall, the backup database can be opened on your phone, its end to end encrypted. That means, the backup database is encripted, and key exists only on the phone that creates it. Go do something better, try to go fishing ..

7 months 18 days ago

can u please help me in code of how to send push notifications from ejabberd server to android app when app is offline like we receive notifications in whatsapp and facebook

Fahad Tariq
8 months 3 days ago

Yes, you can get back your messages but before you need to sync your WhatsApp account with your Gmail id that your conversation and media will be stored on google drive. And If you want to you back up your friends WhatsApp conversation you need to know his/her Gmail account Id and password and add it on your mobile phone and sync it with WhatsApp. And you will be able to recover the conversation if it would exist.

Dowlath Basha G
8 months 23 days ago

Hi, i want to know how text message dictionary works in whatsup.when we type The after that it is gettting punch of words how its working in whatsup message ( text editor ) , please kindly share the information.

8 months 27 days ago

I need someone who can code Erlang to add some features to whatsapp… For example

1. Sending messages automated

2. Creating a list without having to manually add the recipients… Etc

V murugesan
9 months 19 days ago

Hi Ramanathan sir, I have a one doubt. Do you have WhatsApp API in any languages like C#, Python, PHP, Javascript etc?

9 months 25 days ago

Hello, is it possible for you to create an app for me that an improvement of whatsapp? i would like to be able to make conference calls or group calls with that app and i would also like to have video calls with that app. wetchat has a video call but not a group call.

Pankaj Chavan
10 months 19 hours ago

i want whatsapp clone with documentation sharing. pdf sharing. if you are ready to provide i can buy this instantly

10 months 9 days ago

Hi Ramanathan. I am in a despute with a client who claims a whatsapp message I sent wasn’t received until sometime after the app shows it was delivered. Is it possible that the time that the double grey ticks show the Message was received could be wrong?

10 months 21 days ago

can u please help me in code of how to send push notifications from ejabberd server to android app when app is offline like we receive notifications in whatsapp and facebook

Bola Olatunji
11 months 2 days ago

@Ramanthan,Shall we discuss about RCS APP development?