1
votes

I am required to implement a live chat system, somewhat similar to Facebook's in that it must:

  • Allow communication between 2 users
  • Store messages in an inbox/sent box
  • Store messages in inbox, marked unread if the user is offline when a message is sent
  • A language/spam filter must also be active, as needs to monitor communication involving minors.
  • Ideally, this will work on most devices/browsers including mobile access.

I pretty much have a blank canvas for this project in terms of what OS/software to use.

Having done a bit of research it seems like there's a few options / things to think about?

  • PHP/AJAX long polling (Comet-style) with a standard LAMP stack storing messages in a mysql DB
  • LEMP stack (nginx)using the HTTP Push Module, again Comet-style server with a php backend storing messages in a mysql DB
  • Node.js?
  • HTML5 interface to maintain browser/device support?
  • Best DB system for this? Some people suggested mongoDB?
  • Some people also suggested utilising MemCacheQ to boost performance.

What are your thoughts this? Any suggestions?

2
Concerning Chats, i am a friend of WebSockets. - Gary Klasen
I did notice a few suggestions of websockets, but they didn't seem as popular. What do you see as the benefits? - Dave Clarke
@swiss196 It's a new technology (not supported in all browsers) that allows for continuous bi-directional communication, without polling/waiting - Ian
By the looks of things, it's not supported at all by Android so I guess I'd need to provide a fallback method? They look cool and the modern way to go but just don't think I'd have the time to code 2 methods... - Dave Clarke
Comet is a solution: communicating real time data over HTTP. The Websocket protocol does fit into this Comet paradigm, but can also solves other problems not applicable to Comet. WebSockets have their own security layer, and follow different rules. (jfarcand.wordpress.com/2012/04/19/…) - Gary Klasen

2 Answers

2
votes

Check out SignalR as the way of passing the messages between clients, it's the easiest way to create a chat application.

2
votes

This sounds like the sort of thing that the MEAN stack (MongoDB, Express.js, Angular.js, Node.js) combined with either socket.io, or lightstreamer would be good at. Lightstreamer is supposedly faster and more scalable than socket.io (and their live demo's don't make me doubt that), it also has a page in their documentation discussing PhoneGap (they handle phones that don't support WebSockets...which is useful, because, as I understand it, WebSockets aren't supported by most phones)

This isn't my area of expertise though, but it may be worth researching.