News for hackers. Stuff that matters.

How to: Reliable messaging system Mobile to Server

Folks

I am building a simple customer service messaging system for businesses where customers can chat with Agents using mobile. In essence, the mobile app sends and receives messages to/from our server. Any recommendation on what kind of infrastructure should we use (pubnub, pusher, realtime.co) for messaging and the server side recommendation (RoR or node.ja - any issues with RoR?). It's imperative that we don't loose messages and build a reliable and secure messaging system.

( 9 comments | 2 points | on HN )
Re:How to: Reliable messaging system Mobile to Server by jkarneges on Tuesday August 05, 2014 @05:56PM (#8139731)
The key to 100% reliability is data storage. The biggest mistake you can make is relying on bare message passing without ever recording the message anywhere. That approach will break in the mobile world very quickly.

My advice is to build a solid CRUD interface for your chat service and then add a realtime updates mechanism on top of it. This approach is basically bulletproof. I'm a big fan of using long-polling for the push aspect, since it fits cleanly into a REST API and works everywhere.

Re:How to: Reliable messaging system Mobile to Server by helloritesh on Tuesday August 05, 2014 @07:44PM (#8140164)
Thanks J. My worry with CRUD is a constant polling that would be required and it absolutely kills the battery on mobile handsets. Correct me if I am wrong.
Re:How to: Reliable messaging system Mobile to Server by jkarneges on Wednesday August 06, 2014 @10:31AM (#8142629)
The CRUD layer wouldn't be used for live updates. You'd use a separate messaging system for that. My point is that you should build the 100% reliable CRUD layer first, then add on a messaging layer for realtime push. This, as opposed to starting with the messaging layer, and then going in circles trying to patch all the ways it can fail.
Re:How to: Reliable messaging system Mobile to Server by helloritesh on Wednesday August 06, 2014 @11:44AM (#8143045)
J This is fair. Thanks a lot for your suggestion. I'd definitely make sure that we have a CRUD layer for reliable & secure communication.

Regards Ritesh

Re:How to: Reliable messaging system Mobile to Server by helloritesh on Wednesday August 06, 2014 @05:50PM (#8145062)
J

Would you have some cycles to provide guidance on the project - formally? I am looking for some technical experience/depth.

Thanks

Re:How to: Reliable messaging system Mobile to Server by jkarneges on Wednesday August 06, 2014 @10:29PM (#8145998)
Sure, feel free to email me: justin at fanout.io
Re:How to: Reliable messaging system Mobile to Server by helloritesh on Tuesday August 05, 2014 @04:11PM (#8139069)
Additional note: Could I just use XMPP or that may not be sufficient given that the mobile device connectivity could be intermittent? I would love to get the community thoughts on this so I can make the right decision.

Thanks Ritesh

Re:How to: Reliable messaging system Mobile to Server by walterbell on Tuesday August 05, 2014 @04:28PM (#8139200)
Have you looked at https://www.firebase.com/ (paid service)?
Re:How to: Reliable messaging system Mobile to Server by helloritesh on Tuesday August 05, 2014 @05:06PM (#8139424)
Thanks Walterbell. This is useful and I'd investigate further. Looks like Firebase is a combination of Pubnub and Push.