deepstream.io icon indicating copy to clipboard operation
deepstream.io copied to clipboard

Missing compatability notes in v2.0.0

Open TertiumQuid opened this issue 10 years ago • 12 comments

After the changes in 2.0 the following configuration doesn't work because httpServer is no longer a configuration option:

var app = express();
deepstream.set( 'httpServer', server );

See the express example project for example: https://github.com/deepstreamIO/ds-tutorial-express

Is there a new configuration option for setting the http server, or else a recommended new approach?

TertiumQuid avatar Nov 26 '16 12:11 TertiumQuid

Also, if this is incompatible, this is not in the CHANGELOG: https://github.com/deepstreamIO/deepstream.io/blob/master/CHANGELOG.md

cristiano-belloni avatar Nov 27 '16 01:11 cristiano-belloni

Hey,

As part of the 2.0 release we removed the ability to set a http server. This was done as part of a move to treat deepstream as an independent server rather than an addon to an existing one.

The primary reason for that for speed and resources. We are slowly moving more and more of our server into c++ land, which consumes alot less memory per connection. This means the http server will be replaced by a much more lightweight version without all the NodeJS bells and whistles we don't need. Since we are not planning on doing another major release for over a year removing this in 2.0 was the best option.

I'm not sure if this would work, but running deepstream and your http server in a node cluster might actually allow both servers to share a port ( while running in separate processes, also a win ). I would need to setup an environment and see if that works once I get some time.

Option B would be to setup a loadbalancer infront of your http server and deepstream and proxy calls accordingly. This is usually the recommended setup since we also don't recommend running ssl termination directly on deepstream since its an expensive task.

In regards to changelog, that is a good catch! We are going to do a release pretty soon and will put it in there as a patch. Thank you pointing that out.

yasserf avatar Nov 27 '16 14:11 yasserf

This was done as part of a move to treat deepstream as an independent server rather than an addon to an existing one

I appreciate your focus in only one direction, for performance and simplicity's sake. However, I hope it doesn't mean the server will only be standalone (ie it won't be available as an NPM module) in the future.

cristiano-belloni avatar Nov 28 '16 00:11 cristiano-belloni

No, we will always have it as a node module. The entire ecosystem is based on the rich libraries/tools provided by node, such as all the connectors to different subsystems. The main goal is just to prevent users code to be run directly within the server codebase for security and performance reasons ( such as data transforms ) but rather through plugin APIs which can be used from both node directly or via the binary installs.

yasserf avatar Nov 28 '16 01:11 yasserf

Seems reasonable! Thank you.

cristiano-belloni avatar Nov 28 '16 07:11 cristiano-belloni

@yasserf When can we see this node cluster style set up

joshua1 avatar Dec 01 '16 16:12 joshua1

FYI, I think this doc needs updating to remove the httpServer example: https://deepstream.io/docs/server/node-api/

TertiumQuid avatar Dec 01 '16 18:12 TertiumQuid

Also, this blog entry should be updated to mention it only works with deepstream 1.x. It would be great if there was another post mentioning how to achieve Facebook login with deepstream 2.x, and the aforementioned post would include a link to it. Let me know if you think it's necessary to add a separate issue for this.

geecu avatar Dec 08 '16 12:12 geecu

A separate documentation issue would be great against the website, just link it back here!

yasserf avatar Dec 09 '16 10:12 yasserf

bugger - I just hit this as well :( the tutorial is still there, showing how to use httpServer. So, if we wanted to use passport or something like that to secure the routes, how would we achieve this now in 2.0 ?

jmls avatar Jan 18 '17 10:01 jmls

If you have removed the usage of httpServer, then how else can we work with deepsteam and node?

LukeXF avatar Jul 11 '17 08:07 LukeXF

deepstream v3.2 onwards uses uws0.15 under the hood. Generally each connection endpoint is sandboxed and hence is responsible for having its own endpoint / server. Late update sorry, wanted to provide context before closing issue

yasserf avatar Mar 11 '19 09:03 yasserf