WhatsApp architecture

11
WhatsApp Architecture -BY MAHESH BITLA

Transcript of WhatsApp architecture

Page 1: WhatsApp architecture

WhatsApp Architecture -BY MAHESH BITLA

Page 2: WhatsApp architecture

Why WhatsApp is Popular

2

A

B

C

D

Can send Multimedia

Can send Location

Can send Documents

Can send Text messages

E

F

G

H

It is a Ad free application with Optimum performance.

Can Receive Multimedia

Can Receive Location

Can Receive Documents

It is a Ad free application with Optimum performance.Can Receive Text

messages

Optimum performance

A

Page 3: WhatsApp architecture

WhatsApp Server Platforms

Backend Erlang- programming language Jabber Open Source FreeBSD- Operating System Yaws – Web Server PHP  BEAM - VM to run ErLang Custom XMPP

Frontend Seven client platforms: iPhone,

Android, Blackberry, Nokia Symbian S60, Nokia S40, Windows Phone,

SQLite

Page 4: WhatsApp architecture

How it actually works- Briefly

In whatsApp every user or contact is treated as ACTOR.

User the actor

Aardvark The actor

Aarivinci The actor

Aaronitch The actor

Page 5: WhatsApp architecture

Hi

Hi

Tom’s mobile Brad’s mobile

Brad TomTom The

Actor

Brad The

Actor

If offline- Stores the message in

ServerIf online –

Sends to Brad

Page 6: WhatsApp architecture

The actor principle in WhatsApp

• User tom wants to send a message to User Brad in through Whatsapp• First user tom sends a message to tom The Actor and saves the

message In user Tom’s Inbox naming Brad.• tom The Actor tries to send the message to Brad The Actor and

saves the message in server.• Brad the Actor tries to send the message to user Brad, Until the user

Brad receives the message ,Brad the actor frequently send the message.

• As soon User Brad comes online, message will Deliver to Brad’s Inbox named Tom.

Page 7: WhatsApp architecture

SqLite

SqLite

server

server

Mnesia Backend

DB

if

online offline

Stores the message in the database until

he comes online

Creates the actor object

here for user1

Creates the actor object

here for user2

Page 8: WhatsApp architecture

WhatsApp New feature- Encryption

keykey

Message Encryption with a

key as tag

Message Decryption By matching with

sender keySending through server

Key is the Message Authentication code for that user

Page 9: WhatsApp architecture

What things made Fb to buy WhatsApp

Up to 2009 Facebook chat was written in ErLang, then moved to another programming language. WhatsApp written in ErLang with optimum performance that FB.

Out of 100 users of FB and whatsapp, 75% are daily active on whatsapp but only 52% are active on FB.

It can be useful for Facebook INTERNET.ORG initiative. Whatsapp framework can be used to increase the Facebook efficiency.

Page 10: WhatsApp architecture

Any Questions??????

Page 11: WhatsApp architecture

Thank You !!!