views:

333

answers:

3

I want to develop a chat application similar to omegle.com.

FUNCTIONALITY This website picks up two random people who are logged into the website and then pairs them for a chat session. Now if one of the party A disconnects then the other party B is informed and then the party B is connected to a different party. I want my application to handle heavy load and it should not crash.

TECHNICAL: Now I had a few doubts about the architecture of the application:

  1. Should every message sent by A or B go through the server? Will it cause loading of the server? OR should the server be used only for establishing the connection between the two parties?

  2. I have heard that the omegle.com is developed using python using the Twisted library. I also heard that supports easy scaling and can handle huge loads. If any one has experience with the Twisted framework I would like to hear their comments.

+2  A: 

You can set up some form of P2P connections between your users or you can do it through Servers. It all depends on what your interface is going to be. If its going to be in a browser then I would recommend routing it through a server and just having the some AJAX app that poles for changes.

if you worried about scalability why not write your app to work on Google App Engine and that will take care of a lot of your scalability issues and you just write for the platform.

AutomatedTester
@Automated:Thanks for replying. But googele app engine has some limited bandwidth per month.Right?
per day, but you are not going to reach it with a chat app imo
mnml
http://code.google.com/appengine/docs/quotas.html
mnml
1gb /day input -- 1gb /day output
mnml
I agree with @mnml that you are very unlikely to hit the quota 1,300,000 requests is a lot to fill from the start. Also if you use GAE you can use their XMPP so a lot of the chat stuff is already coded for you
AutomatedTester
+2  A: 
  1. Well, you can't send the message between the two parties specifically, unless you use an appropriately-authorised clientside system (Signed Java Applet, etc), so the answer here is obvious.

-- Edit:

By the way, a trick, for perhaps someone 'new' to programming; if you want to develop an application that "scales" I suggest to you that you not only research what, exactly, you mean by "scaling", but also just implement something, and then see where it goes wrong. It can be fun (arguably) to implement it yourself and find out the issues that other people talk about, with direct experience. You can set up systems to determine the 'load' (in whatever context you determine) it can handle, and then you can determine how to do it better. It is arguably wasted time, if you need to re-write, but perhaps it's valuable. Personally, (having done that already, to a degree) I'd go the research and planning route :)

Noon Silk
@silky.I want to go in the correct direction from the start.I dont want to devlop somethiing that will sufer performace problem later.SO am just trying to get the design right and choose best suitable technology for the purpose.
Then, you have a significant amount of work in front of you, and I doubt seriously that you are interested in doing all of it. You might like to start here: http://highscalability.org/, but before there, think, specifically, about how your system will work, what the slow points will be, and how to solve them (either with sneaky change to your design, a different data structure, more systems, more hardware, whatever). Plan it all out. Then find out it your thoughts are accurate via testing and research.
Noon Silk
A: 
  1. Every request to server cause another load. The best is to pair clients without server. Alternative is to use dedicated light server for handling asynchronous request to avoid overload main website.

  2. About Twisted, everything depends on... For example - my company heavily used twisted for multimedia (streaming and desktop applications). From second side - you can try tornado http://github.com/facebook/tornado or just erlang language http://erlang.org.

bluszcz