开发者

Chat server for Rails

As it is evident that AJAX based chats do not scale, so what would you use for chats? Custom servers? Or any other methods?

Since with Rails each chat connection will take lots of memory, it won开发者_C百科't be feasible to even have Rails run for each message. What do you recommend for use here?


I also tried to implement a sample chat app with AJAX (in built Ajax.updater) but it didn't workout. I'm sure there might be some good ajax solution.

But since this is based on server push technology, try Juggernaut (http://juggernaut.rubyforge.org/). I personally haven't tried, but it seems like it's good.

Or else consider web sockets (in HTML5) if possible.


People often use Evented Ruby for handling problems like this https://github.com/eventmachine/eventmachine one of the examples in a talk I went to at railsconf 2010.

For example http://playtype.net/past/2009/3/11/mini_an_eventmachine_clone_of/ is a evented ruby implementation of an irc bot


Unfortunately your post is based on a false premise. AJAX based chat certainly can scale, you just have to do it the right way. Juggernaut 2, for example, uses Node.js to handle many concurrent connections. You're right, you won't be able to handle 10,000 connections on a single server. That's what load balancing is for.


Do you have some data based on quantitative testing (aside from your own qualitative conclusions)?


Why create any kind of custom server for chat? IRC has been around for quite a while and is tried and tested.

The real question here should be about client-side implementations rather than trying to reinvent the wheel server side imo.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜