0

I have built a small jQuery chat widget and am now realising that the solution i have used is really using a lot of load on the server when more than 10x users at the same time.

The solution ive built is using a jQuery jsonp request that is kept alive to check for new data (from a php script that queries the mysql db for new messages) this is what is causing the load..

Unfortunately i now have to rebuild most of the server side code.. Before i do i wanted to come here and ask if there is some way i could implement this with Node.js?

What i really want is: - Keep the MySQL db for storing - only rewrite the posting comet that i currently have which is causing the load

Is it somehow possible to write a Node.js server that stores each new message in my current MySQL DB?

Oh and most important of all, since it is a widget it has to allow cross site access.. will Node.js do that?

Elvin
  • 367
  • 3
  • 5
  • 16
  • look into using socket.io for the client side layer. and yes, you can use mysql in the node.js server. but, make sure socket.io's cross domain capability doesnt require a file hosted on the foreign domain(it might) – goat Jan 14 '13 at 16:03
  • hmm looks like it does: http://stackoverflow.com/questions/8970880/cross-domain-socket-io – Elvin Jan 14 '13 at 16:07

0 Answers0