2. Index
S What is Whatsapp?
S Protocol
S Architecture
S Language used
S Platform: Backend and Frontend
S Mechanism: Store and Forward, Offline
S Limitations
3. Cooperation tool
S Cooperation: come from
software support to enable
fast and simple
communication, both one to
one or among groups
Whatsapp is an app that hosts
this facility
One to one
One to many
4. What is WhatsApp?
S MIM application for smartphone
S Runs on many mobile platforms (Android, iOS, BBos, etc)
S Requires data plan/internet connection
S Beyond Text: full featured (shared locations, video, audio, pictures,
voice-messages, group-chats, send messages via WiFi, and all can be done
regardless of whether the recipient is online or not)
5. Protocol used
S Whatsapp uses a customized version
of the Open Standard "Extensible
Messaging and Presence Protocol"
S XMPP is a communications protocol
for message-oriented middleware
based on XML.
S XMPP is a relatively simple protocol
that occurs over TCP sockets using
XML language
7. SSL
S The Secure Socket Layer (SSL) and Transport Layer Security (TLS) is the
most widely deployed security protocol used today.
It is essentially a protocol that provides a secure channel between two
machines operating over the Internet or an internal network.
Today the SSL protocol is used when a web browser needs to securely
connect to a web server over the inherently insecure Internet.
S Technically, SSL is a transparent protocol which requires little
interaction from the end user when establishing a secure session
9. LYME or LYCE
S Mnesia: a distributed soft real-time DBMS written in Erlang, developed by
Ericsson to support Erlang where DBMS is required.
Erlang language instead SQL, so developers are allowed to use one language
Benefits for Erlang efficiency , single virtual machine
address space is shared between code and data
S CouchDB: open source database that completely embraces the web
Apache license, it uses the JSON language to store data instead of SQL.
Important feature multi-master application
Data is not stored by relations but each database is a collection of
independent documents.
10. Language
S WhatsApp server is implemented in Erlang
S Server systems that do the backend message
routing are done in Erlang
S The number of active users is managed
with a really small server footprint
Curiosity: Facebook Chat was written in Erlang in 2009, but they went away from it
because it was hard to find qualified programmers
S Before: WhatsApp server has started from Ejabberd that is a famous open source Jabber server
written in Erlang. Originally chosen because its open, ease of start and long term suitable
12. Platform
Frontend
S Client platforms: Ios, Android, BBos, Nokia symbian, Windows Phone
Hardware
S Standard user facing server:
S Dual Westmere Hex-core (24 logical CPUs)
S 100GB RAM, SSD
S Dual NIC (public user-facing network, private back-end/distribution)
13. Mechanism: Store and Forward
Chat server
“A” client code
send
No Push notification
If client B is online
14. Mechanism when offline
All messages are queued on the server until the client reconnects to retrieve the messages.
Different platforms different methods:
- Push notification and wait
- Notification in the App directly in Background
Messages are wiped from the server memory as soon as the client has accepted the
message
15. Limitations
S Max 10 images
S 25 users in group chat
S Time and day of last access
S Reduced length of videos
Notas del editor
• Multimedia messages are sent by uploading the image, audio or video to be sent to an HTTP server and then sending a link to the content along with its Base64 encoded thumbnail (if applicable).
• Some code is usually pushed every day. Often, it’s multiple times a day, though in general peak traffic times are avoided. Erlang helps being aggressive in getting fixes and features into production. Hot-loading means updates can be pushed without restarts or traffic shifting. Mistakes can usually be undone very quickly, again by hot-loading. Systems tend to be much more loosely-coupled which makes it very easy to roll changes out incrementally
Kill the process from the settings