Missing compatability notes in v2.0.0
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?
Also, if this is incompatible, this is not in the CHANGELOG: https://github.com/deepstreamIO/deepstream.io/blob/master/CHANGELOG.md
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.
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.
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.
Seems reasonable! Thank you.
@yasserf When can we see this node cluster style set up
FYI, I think this doc needs updating to remove the httpServer example: https://deepstream.io/docs/server/node-api/
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.
A separate documentation issue would be great against the website, just link it back here!
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 ?
If you have removed the usage of httpServer, then how else can we work with deepsteam and node?
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