I'm currently building a web chat with node.js for the backend. It uses web sockets for the communication between server and client. I haven't worked with node before and I always used PHP/MySQL and Ajax to store and retrieve data. The chat can be compared to MSN etc. with user accounts and contact lists. I was looking for some tips and frameworks, which could help me with developing a website which heavily relies on JavaScript and which does all its communication via node.js.
Thanks for you help!
What would you recommend to store the data? Mongo db (mongoose? mongo-db native?), SQLite? An easy solution would be appreciated.
I would suggest you to use redis, because it is insanely fast.
> Example of benchmark result The test was done with 50 simultaneous
> clients performing 100000 requests. The value SET and GET is a 256
> bytes string. The Linux box is running Linux 2.6, it's Xeon X3320 2.5
> GHz. Text executed using the loopback interface (127.0.0.1). Results:
> about 110000 SETs per second, about 81000 GETs per second.
As client I would use node_redis
Would you send everything via the websocket and would you establish a new connection for every conversation?
websockets are not yet support by every browser(pointing especially to Internet Explorer ;)). I think you should use socket.io which supports multiple transports so that it will work in every major browser.
Is there a way to get around PHP completely?
You could get around PHP completely. Use for example express as your web framework instead of PHP
Would you recommend the usage Backbone.js or Ember.js?
Also need to have a better look at both of them.