title: save text chat in the server with architecture of webrtc+socket.io+nodejs
body: <p>I am building a chat system where I am using webrtc and socket.io + node js for building the system. My problem is how to put back up of text chats on my server while there is 1-o-1 chat. </p>
  
  <p>Approach one could be using webrtc for the chat that is peer to peer communication and with every successful message sent I would hit a web service through Which I could update the db. But this seems to me not a good approach as I have to update db from client everytime and network bandwidth seems to be an issue specially for mobile clients.</p>
  
  <p>Another approach could be sending the messages through socket.io and from the node js server save the chat in db from node js server.</p>
  
  <p>Second approach makes more sense to me but I am looking for the best approach.</p>