Angular 2 and server connection

Hello there,

I have a question about Angular 2 as Client UI and Vertx as my server and Cassandra as my database. I want to know do i need to use RxJS to communicate between the Client UI (Angular 2) and my server (Vertx) or I do not need RxJS. I also intend to use Web-socket protocol instead of HTTP. Can you please help me to figure this out.. Appreciate your help.

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

BigRatConnect With a Mentor Commented:
I must admit I have not used Vertx, but I have used Node.js and Express with Passport. Although there are literally hundreds of tutorials on Node in the Internet, I'm rather old fashioned and still read books. And I prefer the paper ones.

Now looking in Amazon there are quite a lot on Node and Express. I have bought and used "Node.js the Right Way" and "Node.js is Practice". On the other hand there is only one on Vertx, from Pakt Publishing and that one deals with Mind maps and uses Mongo as a database. The Mean stack is Mongo, Express, Angular and Node and this stack is very well described in a variety of books. There are also a lot of places around where you can find help. Particularly with Angular 1. Now that Angular 2 has arrived - with a React like component architecture - it won't be long before the bandwagon creates the necessary resources for the common developer.

Now what exactly is your app requirement and why the scalability which Cassandra brings? If you are looking to store images then you'd be wise to use an Angular service to extract photos from a camera (like ng-camera but there others), use a service to send them to node and a node plugin to talk to the database. You ought to be able to switch databases by simply switching node drivers. And I'd be careful about horses for courses. Namely if I were to store pictures in Cassandra, I'd do user login NOT in Cassandra but in Mongo, for example. That is I'd split the functionality into bits, and apply the relevant technology to those bits. Express authorization with Mongo is a well designed system.
Well the first thing to avoid is building all the infrastructure yourself - which will be fraught with gotchas. There is an Angular service for Vertx - - which one could probably directly use in Angular 2. This service will hide all the details about the communication, but don't forget that Web Socket protocol is negociated via HTTP (it doesn't have to be but it normally is).

As far as Cassandra is concerned this will hide behind Vertx so you'll just need the the Vertx plugin or whatever for Cassandra.

Peronally I'd stick to using Node.js instead of Vertx and simply use HTTP/HTTPS. There's a Node driver for Cassandra and a plugin for Express and there's a LOT of experience and tools for this stack.

I don't see any advantage in using Web Socket protocol given the asynchronus nature of Angular - made even more asynchronous with Angular 2. But if you have Promised......
zolfAuthor Commented:
Thank you for your feedback. I appreciate it!!
So, you recommend me to use NodeJs instead of Vertx. correct? Can you please tell me the pros and cons of Nodejs compared to Vertx and the reason you will go for Nodejs. Thanks
zolfAuthor Commented:
All Courses

From novice to tech pro — start learning today.