WhatsApp is one of the most widely used cross-platform messaging applications. Information is sent immediately, which is why more and more websites include it as another service to facilitate communication with users.
In the next post we are going to see what its architecture is like and how an instant messaging service like WhatsApp works at a technical level.
The two most popular types of chats are Facebook Messenger , which is responsible for saving all messages indefinitely, and the other is WhatsApp , which stores them until they are delivered. Once read and delivered by the target user, they are removed from the server and disappear.
The advantage of a system like WhatsApp is that the communication and transmission of information is practically in real time.
For this reason, when it comes to implementing and discovering the technical scenario of the architecture of an instant messaging system. We must think that it must include a series of functionalities so that it is minimally optimal, like the many of WhatsApp:
First, user information such as status, profile picture, profile ID, and contact details must be collected and saved.
It is essential to save in the cloud (for example in a similar service or like the one offered by Amazon’s S3 ) the images of the users, each one of them with their links.
It is allowed to publish, add, update or even retrieve the information of each user.
The advantage of a system like WhatsApp is that the communication and transmission of information is practically in real time . For this reason, when it comes to implementing and discovering the technical scenario of the architecture of an instant messaging system, we must think that it must include a series of functionalities so that it is minimally optimal.
It is also important to have a clear communication architecture . Users A and B use bidirectional communication to communicate over the network, so you need to know each other’s IP address.
This process ends with a server, users, load balancing (which distributes traffic between multiple servers and avoids network saturation), and the database.
Up to 65K ports will be open during the process . The socket controller will provide information about the web sockets that are connected to each user. Redis is used because it stores and is able to provide both which web socket controller a user is connected to, and whether to connect to another controller on disconnection.
Messenger Service. The API will obtain a repository of all message information through various filters such as user identification, message identification, delivery status, etc. For example, the open source big data solution Cassandra developed by Facebook can be integrated, which is capable of storing large amounts of information.
Data mapping: Every time a user sends a message, a new process is generated in which the information is stored. The chat server will spawn a new process for user A and with user B if he is online. The server identifies the receiver’s name through the PID (Process ID) and is immediately sent. The same process is repeated in reverse, when user B is going to reply to user A.
The service offered by instant messaging and that allows you to check the “last seen” option uses a specific database that stores this information.
Technically every time a user opens WhatsApp, the server contacts this option to send the time details.
Each of the versions of WhatsApp is made with a different language:
Android version: with Java
iOS: with Swift
Windows Phone: C#
The web version: with JavaScript/HTML/CSS
The Mac desktop version: Swift/Objective-C
The PC desktop version: C/C#/Java
Erlang is the main language that has been used for WhatsApp.
FreeBSD for the operating system
Ejabberd is your application server XMPP
BEAM is your Erlang-based virtual machine
Mnesia is your Erlang-based database
YAWS is your multimedia web server
Choosing the right staffing agency partner is crucial for building a strong tech team. This…
In today's competitive business landscape, efficient hiring is crucial for success. Many companies face the…
In an era defined by rapid technological advancements and shifting demographics, businesses face unprecedented challenges…
This year 2022, it's time to renew yourself as a web developer and implement the…
You are about to undertake the development of a mobile application or a website, and…
Among the always legitimate web projects to establish its presence on the net, there is…