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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.