Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDH K
20,163 PointsWhat is the IDEAL Node.js framework for real time app
Hi everyone,
I'm a student here at treehouse and have been taking courses for the past 3/4 months (javascript and php). Now I want to create my first app using node.js and I need some advise on which framework to use. Here's what I want in my app:
-simple multiplayer game sessions (cards, chess etc.)
-real time capability, able to support up to 2,000 concurrent users
-user records and authentications
Development considerations..
-fast
-easily deployed
-able to be written and managed all by ONE person (me)
Right now I am leaning toward Sails JS.
I've looked at Meteor too but for some reason it looks like there's a bit of a learning curve and it does not use npm or any of the tools I've learned here at treehouse cuz it has its own set of tools. Also seems really tricky to deploy.
Would appreciate your thoughts and feedbacks!
2 Answers
Kevin Korte
28,149 PointsI'm incredibly biased, but Meteor is my go to at this point. And as of Meteor 1.3 (Currently 1.4+), it has full support for npm out of the box, and you import your npm packages into your meteor project, when and where you need them, with the same syntax you would use in a more barebones node.js app.
DH K
20,163 PointsWow, thank you for the thorough response!
It seems like Meteor is a fair choice right now. I think that dispels a lot of my doubts.
I know $60 per month for a couple hundred concurrent users is not a lot and I think it will be worth it. But you mentioned revenue. I'm pretty sure there's a way to integrate payment gateway into the app, but let's say you are trying to convert real money to cyber-money or game points. For this I know transactions are essential.
Is SQL integration too much of a hassle right? How do Meteor developers resolve this issue. The thing about the mini-Mongo and easy integration of account system sounds fantastic but, I think transactions is still a vitally important.
Your feedback will be much appreciated.
Kevin Korte
28,149 PointsHow about that, a month later - sorry!
Yes, there are ways to accept or move money around. Stripe, is one of my favorite solutions for a payment gateway, and it works with Meteor. Pretty much any payment gateway that says it can work with Node, should be able to work in Meteor no problem.
And yes, SQL integration is probably too much of a hassle at this point, I'd say you'd be better off using straight up node with with whatever other frameworks you need. Meteor has said SQL integration is coming, at some point, but have not alluded to when that might be, and I haven't seen much chatter around this, so I'm guessing it's low on the list.
There probably are some 3rd part sql packages, but your mile will vary. I personally have loved (more than I thought) Mongo. I was hesitant at first, but it's been very flexible and easy to use. Although SQL still has it's use cases if that's what you want to use, or need to use, I certainly understand. I haven't hit any limitations with Mongo yet, and I'm not sure where I would with many or most type of web apps that would/could be built.
DH K
20,163 PointsDH K
20,163 PointsThanks for the response. I did not know they supported npm.
I did some more research online and the opinions tend to be very polarized. Some are ecstatic about the framework but overall my opinion has changed for the positive. It seems to be the general concensus that it is easy and fast to develop but difficult to deploy and scale.
My concerns about Meteor...
What would be the typical front-end library you use with Meteor. I've heard Blaze mentioned, but this obviously seems limited to only Meteor. Are the skills I have learned in jquery, ajax, express, angular, react translatable to meteor. How do these technologies tie into the framework, which ones are used or important.
I get that Meteor is now good enough for production now, but how difficult is the deployment part. What is the recommended route to support the potentially many concurrent users...minimum hardware requirements, costs.
Is Meteor monolithic or microservices architecture. How much of the code that you write in Meteor reusable in other frameworks or no frameworks.
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsYou bet
Like I said, I'm incredibly biased, cause I've been working in meteor for close to a year, and I love it. I currently have three projects I'm working on in meteor.
I would say it's moderate to develop in speed and ease. Like any framework, it has it's own ecosystem that'll you'll have to get familiar with, but it does abstract a lot of the more difficult parts away, just doing them out of the box (live near real time data) with a simple pub/sub.
As far as scale and deployment, I don't have much experience in that yet, but I had the same concerns. Here is what I found.
Meteor started their own hosting service about a year ago: https://www.meteor.com/hosting and it doesn't seem to be any more simple than that. It's ran on top of AWS, so you can trust the hardware will be good. Downside it's a more expensive option. Too expensive for your own personal site or blog, IMO, but if you were building a site to make money, it's reasonable, especially considering how much of the set up they take care of.
There is also https://modulus.io/meteor . Nothing really wrong with it, I've seen good reviews. I've also seen unoffical, but very heavily used meteror buildpacks for Heroku here: https://github.com/jordansissel/heroku-buildpack-meteor and you can even set it up on digial ocean, here: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-meteor-js-application-on-ubuntu-14-04-with-nginx
Digital ocean is the cheapest I believe, but you have to set up the server environment yourself, which can be a lot of work. That's not meteor's fault, that's just what D.O. is, they give you an empty server box, with a OS of your choice, and you're responsible for setting everything up. For SysAdmins it's a paradise in heaven for them, for me, I love D.O. for many things, but I'm not a great SysAdmin, I need training wheels, so I'm willing to pay more per hour for something pre-config'ed.
And of course AWS, same boat as D.O.
I believe with all of these, you'll also need to host your mongodb. Two big players I'm aware of, https://www.compose.com/mongodb and https://mlab.com
I don't have much of a preference, yet. Both seem great. Mlab gives you a free small, sandbox, compose only has a free trial, if you want to just mess around.
Technically, meteor core doesn't have a front end. Meteor did write blaze, which is basically a modified version of Handlebars.js, which they called spacebars. However, meteor fully supports react and angular, its just as easy as removing the blaze package, and adding the react or angular packages.
Other skills, meteor comes with jquery installed, but you can change the version to whatever you like, either by cdn, or npm, it's your choice. Ajax is not relevant in meteor, you'd never ajax anything, the pub/sub model is far superior, and that's not a meteor thing, you can pub/sub in other languages too like php or ruby, it's just very prevalent in node.js based apps. Express isn't used in meteor. But there are plenty of packages to provide the same functionality. (FlowRouter)[https://github.com/kadirahq/flow-router] is the current go-to routing package for meteor apps, and for server side routes, or middleware, (meteorhacks picker)[https://github.com/meteorhacks/picker] is the go to, however there are other options, or you can roll your own. Angular and react we already talked about.
I can ballpark costs, to get a basic meteor app up and running, you're going to be about $60 a month for app hosting and database hosting only. It'll scale up from there. That's probably good for a couple hundred users, a couple thousand users and you'll probably be $120 plus. That's not bad if your app has a model for producing income.
Monolithic or microservice - you can go either way. I'd say most are monolithic by choice, but if you want to break the app up, you can, they explain that in their official guide: https://guide.meteor.com/structure.html#splitting-your-app
How much is reusable...that's tough, depends on what you're moving too (base node.js I'd assume). It's fairly portable, as most of the code you'll write is basic ES6 (or newer when it comes out), written inside of meteor methods, objects, and callbacks.
I would recommend you read the (Meteor Guide)[https://guide.meteor.com]. It's a long read, it took me about 3 days to get through it all, but I did, and it really answered a lot of questions for me, and was what made me decide to go down this route, and I'm happy I have.