Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,132 members, 7,814,954 topics. Date: Thursday, 02 May 2024 at 01:43 AM

Does Anyone Know How This Feauture In Facebook Was Created? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Does Anyone Know How This Feauture In Facebook Was Created? (1593 Views)

Gtbank Buying Credit From Your Account --does Anyone Know The Technology Behind? / If facebook Was Nigerian (2) (3) (4)

(1) (Reply) (Go Down)

Does Anyone Know How This Feauture In Facebook Was Created? by Javanian: 3:48pm On Oct 29, 2012
Was on Facebook today and i was wondering how their embedded chat application was created. Does anyone have an idea?

Re: Does Anyone Know How This Feauture In Facebook Was Created? by lordZOUGA(m): 4:26pm On Oct 29, 2012
server push or web sockets
Re: Does Anyone Know How This Feauture In Facebook Was Created? by Javanian: 5:17pm On Oct 29, 2012
Thanks for your reply but Is the chat application a stand alone embedded in the web application with server push/web sockets? Can you please throw more light on this?
Re: Does Anyone Know How This Feauture In Facebook Was Created? by lordZOUGA(m): 6:10pm On Oct 29, 2012
hmmm... I would stick my neck out and say its embedded in the web application because it would be the sanest thing to do. Making it run as a stand alone application would mean running the chat application as another process and that comes with the added overhead of inter-process communication which means more data
Re: Does Anyone Know How This Feauture In Facebook Was Created? by lordZOUGA(m): 6:20pm On Oct 29, 2012
... Or I could be wrong and they could be using a software like this http://www.pichat.net but google can give you much more references that can give you more insight
Re: Does Anyone Know How This Feauture In Facebook Was Created? by Javanian: 7:22pm On Oct 29, 2012
Thanks alot...i really appreciate...
Re: Does Anyone Know How This Feauture In Facebook Was Created? by Javanian: 7:25pm On Oct 29, 2012
What of the feature for online members? Do you know what they use and how they do it? I think they use AJAX but i might be wrong...
Re: Does Anyone Know How This Feauture In Facebook Was Created? by spikesC(m): 8:15pm On Oct 29, 2012
research on Erlang, am on mobile, should have wrote you a comprehensive answer. and No, its not embedded on the web application. It runs seperately, i've don a very deep research on it. i even have an e-book they wrote on it.
Re: Does Anyone Know How This Feauture In Facebook Was Created? by Javanian: 8:17pm On Oct 29, 2012
spikes C: research on Erlang, am on mobile, should have wrote you a comprehensive answer. and No, its not embedded on the web application. It runs seperately, i've don a very deep research on it. i even have an e-book they wrote on it.
Please when you are on P.c. try and give a comprehensive answer. I will really appreciate it...
Re: Does Anyone Know How This Feauture In Facebook Was Created? by codeaddict(m): 11:15am On Oct 30, 2012
Read this book: Facebook-Erlang Factory
Re: Does Anyone Know How This Feauture In Facebook Was Created? by ektbear: 4:31pm On Oct 30, 2012
AJAX on the front end, communicating to some web server, which then routes to a chat server.

A variant of this, I would imagine.
Re: Does Anyone Know How This Feauture In Facebook Was Created? by lordZOUGA(m): 4:34pm On Oct 30, 2012
ekt_bear: AJAX on the front end, communicating to some web server, which then routes to a chat server.

A variant of this, I would imagine.
makes sense
Re: Does Anyone Know How This Feauture In Facebook Was Created? by Nobody: 6:08pm On Oct 30, 2012
i dont have the current update as they may have gotten a better solution

sometime last year, i integrated facebook chat into an actionscript project(now they have an as3 library that does just that using jabber), they use the comet approach like here
http://www.zeitoun.net/articles/comet_and_php/start

and if you ever ran wireshark recently, you will notice that facebook does short polls for changes
maybe that approach is better than using comet.
Re: Does Anyone Know How This Feauture In Facebook Was Created? by naijaswag1: 10:50am On Oct 31, 2012
ekt_bear: AJAX on the front end, communicating to some web server, which then routes to a chat server.

A variant of this, I would imagine.

Easier said than done. Sounds very simple. The frontend features of facebook could not have been successful without ajax. They will surely be some dedicated servers built in suitable languges for the chat application as facebook is built on a plethora of languges. Each languge used to develop any features it supports best. I have seen tutorials on ajax chat on google. You need to be able to do browser hacking so that you can bring up your own interface for the chat. Being able to program a chat server embedded in a browser will give you more insights.
Re: Does Anyone Know How This Feauture In Facebook Was Created? by Nobody: 7:23am On Nov 03, 2012
Simple ajax.
With the number of people on chat every second, if each were to hold down a socket via persistent connection push, there would not be enough sockets on the servers.
Even if they scaled out the hardware for it and were able to accomodate an infinite amount of persistent socket connections, YOU dont have that kind of money or hardware for that right now.
Re: Does Anyone Know How This Feauture In Facebook Was Created? by Javanian: 7:58am On Nov 03, 2012
Thanks for the tips @all
Re: Does Anyone Know How This Feauture In Facebook Was Created? by sarutobi: 8:56am On Nov 12, 2012
To clarify things, facebook uses realtime data streaming. They employ a technology that very similar to the comet server where connections are held by clients for a very long time and instead of each clients polling the server to check for updates, the server simply 'pushes' any updates to the clients. This way, it can scale to millions of clients just on a single box.last time I checked they use this same technique for their news feed, messages and notifications. The frontend is written in javascripts and the backend is written in java (they were using cassandra. But I don't know abt no sha.).

There is an open source project that does something similar: the ape server. U can dig in the code to know how it works in details.
Re: Does Anyone Know How This Feauture In Facebook Was Created? by sarutobi: 9:13am On Nov 12, 2012
2buff: Simple ajax.
With the number of people on chat every second, if each were to hold down a socket via persistent connection push, there would not be enough sockets on the servers.
Even if they scaled out the hardware for it and were able to accomodate an infinite amount of persistent socket connections, YOU dont have that kind of money or hardware for that right now.

You are absolutely right. But there is a workaround. According to http 1.1 specifications a browser can only open a max of 2 connections to a webserver causing any other connections to be blocked. But we can create a diff hostname as an alias to the chat server. This way we escape that limitation. I believe this is what facebook is doing. Also I know (I have not tried this) that some servers can be tweaked to handle over 100000 TCP connections at a time. This largely depends on the operating system ur server is using. For facebook and their datafarms that's no biggie.
Re: Does Anyone Know How This Feauture In Facebook Was Created? by Nobody: 6:52pm On Nov 12, 2012
Facebook has also introduced video chatting application that is downloadable....
Anyone seen it?
Re: Does Anyone Know How This Feauture In Facebook Was Created? by WhiZTiM(m): 11:41pm On Nov 15, 2012
Facebook's chat system is majorly implemented in Erlang... But do have some other bindings to it.
Here is how it works... There is a modified server, MochiWeb, that is designed to handle massive pools, persistent and concurrent connections. Theres the XMPP framework that kinda gives a universial API between the client and Server.

The webserver has a pretty large cache to use, and there is a slight delay before messages are committed to their user database, when you are online, your messages are taken from your inbox table in the database + your temporary messaging box in the chat server... This is to reduce the latency between you and your mate... This technique could keep that time as low as 0.08s.

The good thing is that, there is an extra pool of hundreds of GB of memory shared accross clusters to ease load balancing and rerouting of connection to free nodes.

@Javanian, you may want to check out, Comet, concurrency and pooling...
- I hope I've eased some curiosity.... :-).

1 Like

Re: Does Anyone Know How This Feauture In Facebook Was Created? by WhiZTiM(m): 11:49pm On Nov 15, 2012
Check out the super fast "Varnish caché server". I think Facebook uses that alot. Google it

1 Like

(1) (Reply)

Lisfollow (a Thirdparty Follower Stat Tool For Linda Ikeji Social) / C.A.C Website Palava! Who Designed This Website? / How To Fix Phpmyadmin Error “incorrect Format Parameter”

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 27
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.