I have a chat app made in node/socket.io.

Scalability factors have made us choose Erlang/Ejabberd/xmpp and it will replace node/socket.

I have a few questions:

  1. Currently using MySql for chat storage. Best alternative considering scaling and consistency as major factor?
    Reason why I am switching : a row for single message is not the best thing to do, but since I am using MySql I am not left with any other option. Growing userbase doesn't help either.(Mnesia|Riak|MySql|PosgreSQL??)

  2. How to send my chat messages from javascript to my Erlang code for storing/processing. I have done web development in past and ajax made my task very simple for client-server interaction. Node/socket event handler made my job easy while developing chat app. How will server and client interact in this scenario?

  • Have you considered using CouchDB or MongoDB?
    – Knerd
    Nov 8, 2014 at 23:06
  • Have you thought of storing your chats in a file? You're only appending to it after all, and could import it into a more easily searchable service (eg MySQL) after the chat is closed. Do you know that node is the bottleneck and not the storage.
    – gbjbaanb
    Mar 9, 2015 at 11:46

1 Answer 1

  1. Why not use something like Amazon s3 for your chat storage? I don't think you're going to find a higher scalability or availability outside of hosting your own cloud. Not sure how long your messages need to be stored either (Until the end of time?).

  2. You're looking to have Erlang support REST services right? Here's a relevant SO question which namely calls out Mochiweb, Webmachine and Nitrogen. These will allow you to send and receive REST events to an erlang server. If you want to do AJAX over that, you could.

  • How would you store messages in sth like S3 or Azure? I mean a db is probably the best to use.
    – Knerd
    Nov 8, 2014 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.