1,105,594 Community Members

web sockets or ajax for web instant messaging

Member Avatar
pwolf
Junior Poster
147 posts since Dec 2011
Reputation Points: 14 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

If you were to build a fairly complicated website, and you wanted to add features like instant messaging (one to one and multi-chat like a chat room, and possibly if the site becomes profitable enough, voice/video chatting) and you wanted to be able to store these chat sessions, would it be better to use AJAX or Web Sockets? What would be the pros and cons of each technology?

p.s The backend development will be done with python and django.

p.p.s An irrelvant question, but what would be the best way to store such communications to reduce redundancy, would you just throw all chat sessions into a table along with the usernames or user Id's of those who were involved in the chat session, and return all the conversations a particular user has participated in and display ordered by date/time? I'm new to this stuff, so sorry if I come across as a total idiot.

Member Avatar
noelthefish
Junior Poster in Training
82 posts since Apr 2009
Reputation Points: 5 [?]
Q&As Helped to Solve: 10 [?]
Skill Endorsements: 0 [?]
 
0
 

look at www.pusher.com

This allows you to use websockets and a Flashbridge if needed and a basic 10 user testing sort of package is free.

you can easily store all messages in a table and with a little bit of a fiddle you can be up and running in about an hour.

There are even some demos on there showing how to code a chat room with multiple users and authentication.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: