I am eager to know about the architecture of different real-time messenger apps. Are they using any generic protocol/architecture?
相关问题
- How to set delegate in a protocol extension
- Shared common definitions across C/C++ (unmanaged)
- Using associatedtype in a delegate protocol for a
- Long-lived RESTful interactions
- Flutter BLoC: Is using nested StreamBuilders a bad
相关文章
- How to invoke phone dialer in browser? or is it im
- Writing a stream protocol: Message size field or M
- Why doesn't there exists a subi opcode for MIP
- Swift: overriding typealias inside subclass
- DDD Architecture - Where To Put Common Methods/Hel
- Proper scenekit architecture for multi level/scree
- swift change theme using delegate and protocol on
- MySQLi Error Handling?
WhatsApp has chosen Erlang a language built for writing scalable applications that are designed to withstand errors. Erlang uses an abstraction called the Actor model for it's concurrency - http://en.wikipedia.org/wiki/Actor_(programming_language) Instead of the more traditional shared memory approach, actors communicate by sending each other messages. Actors unlike threads are designed to be lightweight. Actors could be on the same machine or on different machines and the message passing abstractions works for both. A simple implementation of WhatsApp could be: Each user/device is represented as an actor. This actor is responsible for handling the inbox of the user, how it gets serialized to disk, the messages that the user sends and the messages that the user receives. Let's assume that Alice and Bob are friends on WhatsApp. So there is an an Alice actor and a Bob actor.
Let's trace a series of messages flowing back and forth:
WhatsApp actually uses the XMPP protocol instead of the vastly superior protocol that I outlined above, but you get the point.
The WhatsApp Architecture Facebook Bought For $19 Billion explains the architecture involved in design of whatsapp.
To my knowledge, Ejabberd (http://www.ejabberd.im/) is the parent, this is XMPP server which provide quite good features of open source, Whatsapp uses some modified version of this, facebook messaging also uses a modified version of this. Some more chat applications likes Samsung's ChatOn, Nimbuzz messenger all use ejabberd based ones and Erlang solutions also have modified version of this ejabberd which they claim to be highly scalable and well tested with more performance improvements and renamed as MongooseIM.
Ejabberd is the server which has most of the featured implemented when compared to other. Since it is build in Erlang it is highly scalable horizontally.