Building a chat application like whatsapp, fb messenger, hike, etc involves quite some setup but to get an idea in the most simplest manner, read below.

The whole setup is split into 3 blocks .

  1. Client facing app
  2. Messaging Channel
  3. Server setup/infra to handle messaging transactions at scale

In summary the tech involved would be

Client facing app

  1. App ( which involves all the UI and basic UX, Android/iOS/Windows) [You can use libraries here]
  2. Database to save data in device/work offline [SQLite/Realm]
  3. Manage states for the device (i.e network change, calls ,etc) and respond for messaging based events [API dependent and available in target OS]
  4. Maintain a connection with the server ( via Sockets, XMPP, MQTT)
  5. Push Notifications[Firebase Cloud Messaging, Urban Airship, One Signal]
  6. [optional] Media ( video/picture) and location feature [Google Maps SDK, Android Media Framework API]


  1. Choose from Socket, XMPP or MQTT [Could be a mix of them too, depending on use case]
  2. Make sure of the use case ,
    1. mqtt is for mobile devices and iot (preferred, refer to Paho Project)
    2. socket if you have desktop app (preferred)
    3. xmpp can work in both depending on the scale (GCM uses this)


  1. Setup an infra that takes care of saving messages as they come/go
  2. Load balancing on the server to manage scale when the number of connections increase/decrease
  3. Id management to know which connection to use between two Id, maintaining the messaging logic
  4. Setup topics to manage delivering messages as well as push notes
  5. Database management
  6. Error Handling to be resilient to messages being lost and error in network
  7. [optional] Set up end-to-end encryption , to maintain user privacy, if not ..make sure data is not sent in plain text over the air.
  8. To handle all the above you have to
    1. Code the logic in one of the server side language. Possible contenders would be NodeJS, Erlang, etc.
    2. Have a cloud infrastructure , possibly Google Cloud Platform/AWS/Azure
    3. API Specifications based of protocol(MQTT/XMPP/SOckets) used for messaging
    4. Database could be NoSQL – Mongodb/Aerospike or SQL
    5. End-to-End encryption via the open source tech available OpenWhisper Systems

P.S : This is a simple answer , the stuff that goes on is complex and involves a lot of understanding on how to manage messages.

This post was originally published on Quora here.

With the rise in competition wherein chat and messaging is playing a vital role for various businesses it becomes imperative for every application to have an established real-time communication channel. On top, it is just matter of minutes to integrate such an awesome user-friendly functionalities/features with readily available chat and messaging SDKs like Applozic.

  • This one’s pretty cool and essential to non-coders. It helps them know what’s behind every chat application they’re using. Great content. Looking forward to reading more stuff like this.

Related Posts


Applozic vs Hyphenate: Which Chat SDK should you choose for In-app Chat?

The messaging app era is here. This isn’t something I am telling out of intuition, but there are a number of statistics and major trends to testify it. For instance all the hype around Chatbots Read more…


Top 20 iOS Developers Blogs Who You Must BookMark

Mobile applications are widening their utility in multiple aspects every day. Technologies like Augmented Reality, IOT, Virtual Reality, GPS, Beacons are becoming part of our life both in a personal or professional sphere. Enterprises, no Read more…


Top 5 tips and tricks to delight customers with Customer Support Chat

With more and more businesses springing up in the digital space, coupled with the rapid rise of the digital natives the customer support landscape needs a major reshuffle. As a business owner or a product Read more…