I would to create a real-time web chat application using web.py in python. The problem is that I don't know how to 'architect' or design the such an app. The way I'm thinking to implement this app is the following: a user logs into the app. the app connects to a controller that has a push service to push new messages and a queue service to store the new messages. when the user sends a message, the app sends the message with an ajax call to the controller and the controller stores the message in a queue. then the controller sends the messages in the queue to the destination user by its push service. However I see this is a very poor design since I see a lot of ajax requests being sent here. I really don't know if there are better designs or architectures for such a service. So can you please point me toward the correct design for a real-time chat app? Continue reading...