1

Recently, I found myself wanting to develop a web application using real-time technologies. As far as I see, I have two ideal solutions.

  • Use WebSockets. (in my case Socket.io)
  • use a real-time database like RethinkDB (I guess stuff like Pusher and PubNub also fall into this category too)

I am lost, however. What are the technical differences between these two solutions? When should I prefer one over the other?

James Parsons
  • 6,097
  • 12
  • 68
  • 108
  • 1
    PubNub and Pusher are a bit different than a data syncing technology like RethinkDB. PubNub and Pusher are more focused on the transmission of data from one device to one or more devices. RethinkDB is more of persisting of data from client to server and likely to other clients in a more traditional database insert/update/delete type fashion. – Craig Conover Sep 19 '16 at 15:17

1 Answers1

2

They actually work really well together. Using RethinkDB changefeeds to watch for changes in the database and then using socket.io to pass those changes to the client(s) is a good way to use them in tandem. I'd recommend taking a look at Jorge Silva's answer to this similar question.

socket.io vs RethinkDB changefeed

I was only familiar with this because of a tutorial I did with an interesting tech stack of React, Redux, RethinkDB, Express, & Socket.io. I'm not sure what you're using for your front-end/view layer but this might be helpful for learning how to integrate RethinkDB+Socket.io

http://webapplog.com/reactive-web-stack/

Good Luck!

Community
  • 1
  • 1