Sometimes while chatting if I send a message to a friend in chat in one window and switch to another window/tab where facebook is open(and naturally chat window is open too), the my msg automatically pops up there.
Similarly if a friends pings you, ping goes to all facebook loaded windows/tabs. Don't want heavy details but how does facebook manage this.
Here's a blogpost on the subject by facebook: https://www.facebook.com/note.php?note_id=14218138919
What you want to know is most-likely described in this paragraph:
For Facebook Chat, we rolled our own subsystem for logging chat messages (in C++) as well as an epoll-driven web server (in Erlang) that holds online users' conversations in-memory and serves the long-polled HTTP requests. Both subsystems are clustered and partitioned for reliability and efficient failover. Why Erlang? In short, because the problem domain fits Erlang like a glove. Erlang is a functional concurrency-oriented language with extremely low-weight user-space "processes", share-nothing message-passing semantics, built-in distribution, and a "crash and recover" philosophy proven by two decades of deployment on large soft-realtime production systems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With