python - The architecture of a real-time web chat app -


i create real-time web chat application using web.py in python. problem don't know how 'architect' or design such app.

the way i'm thinking implement app following:

  • a user logs app.
  • the app connects controller has push service push new messages , queue service store new messages.
  • when user sends message, app sends message ajax call controller , controller stores message in queue.
  • then controller sends messages in queue destination user push service.

however see poor design since see lot of ajax requests being sent here. don't know if there better designs or architectures such service. can please point me toward correct design real-time chat app?

alex,

this understandable question, thought when building own messaging application. way broke down app's functionality:

       user registration        user authentication        adding new friend username        approving friend        messaging friend in list (of course)        shows online , offline users        runs background service in order messages when application closed.        uses notification area when new message received.        quiting application(kills background service) 

a few things realized after building application was:

  1. the back-end architecture simple mixture of simple crud application pub/sub functionality. can read more on pub/sub systems here. here's simple chat application built using ruby on rails. can @ reference, it's architected.
  2. you should think last steps listed in above functionality in beginning of app in end. if architect in beginning, final steps fall place! :-)
  3. if want learn concurrency , cool, suggest trying implement of frameworks discussed here.

please let me know if have questions!


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -