0

I have one misunderstanding with Deepstream.io. It has both NodeJS SDK (which can make client for deepstreamHub from my node application) and NodeApi, which allows to install deepstreamHub as npm package. Why do we need both of this options? When should I use each of the option?

For example, I have existing realtime node app, which uses socket.io as transport layer. And I want rewrite app and migrate from socket.io. What option should I use? Install deepstream as a package in existing app and call my app logic in RPC callbacks, or install standalone server on computer, then install deepstream.io-client-js in my app and also register my app logic as RPC callbacks, using ds.rpc.provide ? I do not understand difference of two approaches

Stalso
  • 1,468
  • 2
  • 12
  • 21

1 Answers1

1

It looks like there is a misunderstanding between deepstreamHub[1] (the cloud platform) and deepstream[2] (the standalone server).

If using deepstream the server, you'll likely need to host it yourself on a cloud provider (AWS, Azure, etc). With deepstreamHub you get given an application endpoint which you can connect to and a dashboard to manage your application permissions, authentication methods and data.

Either way you'll need to install the deepstream.io-client-js module in your application, you can then connect to your server or your application endpoint (if using deepstreamHub).

After this you can register app logic as RPC endpoints and proceed to write your app logic as normal.

[1] (https://deepstreamhub.com/)

[2] (https://deepstreamhub.com/open-source/)

Alex Harley
  • 353
  • 1
  • 3
  • 13
  • But why do we need deepstream as npm package then? – Stalso Oct 18 '17 at 08:36
  • 1
    Using it as an npm package has a few benefits: - you can run it alongside another server (such as express, koa etc) in the same process - can set your own plugins without having to bundle them properly (https://deepstreamhub.com/docs/server/node-api/#set-key-value-) - can run via a process manager like pm2 – Alex Harley Oct 19 '17 at 11:09