简体   繁体   English

Deepstream.io。 Node Api与NodeJS SDK

[英]Deepstream.io. Node Api vs NodeJS SDK

I have one misunderstanding with Deepstream.io. 我对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. 它同时具有NodeJS SDK(可以从我的节点应用程序使deepstreamHub成为客户端)和NodeApi,后者可以将deepstreamHub作为npm软件包安装。 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. 例如,我有一个现有的实时节点应用程序,它使用socket.io作为传输层。 And I want rewrite app and migrate from socket.io . 我想重写应用程序并从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 ? 将Deepstream作为软件包安装在现有应用中,并在RPC回调中调用我的应用逻辑,或在计算机上安装独立服务器,然后在我的应用中安装deepstream.io-client-js ,并使用ds.rpc.provide将我的应用逻辑注册为RPC回调ds.rpc.provide I do not understand difference of two approaches 我不明白两种方法的区别

It looks like there is a misunderstanding between deepstreamHub[1] (the cloud platform) and deepstream[2] (the standalone server). 在deepstreamHub [1](云平台)和deepstream [2](独立服务器)之间似乎存在误解。

If using deepstream the server, you'll likely need to host it yourself on a cloud provider (AWS, Azure, etc). 如果使用深流服务器,则可能需要将其自己托管在云提供商(AWS,Azure等)上。 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. 使用deepstreamHub,您将获得一个可以连接到的应用程序端点和一个仪表板,以管理应用程序权限,身份验证方法和数据。

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). 无论哪种方式,您都需要在应用程序中安装deepstream.io-client-js模块,然后可以连接到服务器或应用程序端点(如果使用deepstreamHub)。

After this you can register app logic as RPC endpoints and proceed to write your app logic as normal. 之后,您可以将应用程序逻辑注册为RPC端点,然后继续按常规编写应用程序逻辑。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM