Solved

Angular 2 and server connection

Posted on 2016-11-06
4
110 Views
Last Modified: 2016-11-08
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.

cheers
Zolf
0
Comment
Question by:zolf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 41876137
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 - https://github.com/knalli/angular-vertxbus - 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.

https://academy.datastax.com/resources/getting-started-apache-cassandra-and-nodejs
https://www.npmjs.com/package/express-cassandra

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......
0
 

Author Comment

by:zolf
ID: 41876610
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
0
 
LVL 27

Accepted Solution

by:
BigRat earned 500 total points
ID: 41876995
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.
0
 

Author Closing Comment

by:zolf
ID: 41878351
cheers
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question