Noob friendly Nodejs Hosting!! Heroku vs Open-Shift

Hosting an application which we developed in a new framework is as much exciting as well as challenge than using the framework. And what better way than giving a noob the easiest way to deploy the app? So, created the app, now it’s time for me to deploy. So I went ahead, typed “Free hosting for Nodejs” and as usual trusted Google gives me a lot, but less useful. Either some links/sites have changed, and rest point me to a couple of providers. Heroku and Openshift!

So my scale to measure the best one is simple, how hard it is for me to deploy my app! Took Heroku as a challenge and man, I must say they put a lot of restrictions for a small app, and deploying is a nightmare(at-least for me!). Digged through documentation, did exactly as they say and bam!!! It looks like there were no gears assigned to the app to scale. So as usual, digged some more and do as they say, bam! Not working. And getting MySQL is not easy as I thought.

After waiting patiently for a day, I dropped the idea and turned to Openshift. Installed rhc, cloned repo, made changes and committed. The moment I push I can see the logs on one hand and deployment process on the other. Errors were clear, Connecting to MySQL was pretty easy and I got my app up and running under 30 minutes. Well, that was quick! That’s what I thought! And what’s more surprising is, PHPMyAdmin installation is just easy too!

So what about them? To be clear, There was no pre-conceived notions about Heroku, but things could have been a lot simpler like how Openshift had! If they claim it is dev friendly, then it should be noob-dev friendly too! Let them add Gears, commit the app and bam! No missing dynos gimmick, and don’t expect developer to pay heed to such things. And for gods sake, don’t make installing Relational DBs a chore. It took me a while to figure out Heroku is not for me!

So I request Heroku to make the setting the instance a bit easier like OShift! This will go a long way!

Noob vs Nodejs ORMs(Caminte/Sequelize/node-orm2)

Well, as they say, once you use DB in your app, you will look for ORM! And it happened to me obviously. So what’s so special or different in this post? Well, nothing really. It’s just my perspective, a Java Dev’s perspective, on the ORM eco-system of Node.js. We, Java Guys, rely too much on ORMs. Be it Spring, Play or any framework for that matter, will come bundled with ORM! But not in Node.js. This was a big blow. When I chose Expressjs, I thought I don’t have to write plain DAO like codes anymore, but how wrong am I?

It’s not that writing plain SQL is harder, but it feels too much painful. Too painful, that I have to open a connection, execute statement, close it! Eew, Seriously? People still do that? Anyways, my search started. So like all, I got sucked up into Sequelize with their shiny new home page and all those jargon’s! It all went smooth. It was so smooth, I felt like I can relax now because at this rate I’ll finish the app much before I thought. But boy, Sequelize said NO!

See the thing is, I don’t want to dig SOF or any forums to know simple thing. It should be in the documentation. And when I try to insert inside another insert and it failed with no error, this is a big RED symbol. I debugged, and cried a lot, but no help. So there I am, sitting and crying at 1 AM! So with heavy heart, I decided to go with Caminte, after looking at another shiny page! Same old, Same old. So I thought why not open a Issue! Well, it wasn’t what I expected. No one replied. Well, with last release couple of months ago, and lot of open issues with no response, I decided to knock it off from list.

The bad thing is, Caminte looked like a serious contender in the ORM race. It had all I need, but not support. So while at work, I glanced upon node-orm2. No shiny page, just simple github template. But still I thought, why not? And to my surprise, it did the trick. With such minimal documentation, it just explained things clearly. No hiccups anywhere and debugging was a lot easier compared to those 2 guys! So what was this all about? Me, bitching about famous Nodejs ORM FW for fun? Nope. There are reasons why I am writing this at 2 am. If it ain’t work, then go for the once which work. And that’s what I did. I tried hard to use them, but either due to my sheer negligence or my noob-ishness might have cause some errors, but logs are supposed to be there to give exact error. It is how we fix them and move on. This got me thinking, how come such big popular ORM’s left out such major part? Or am I missing something? Whatever it is, I did the same with all 3 and node-orm2 performed to my expectation. Which means. this guy gets it!

  1. ORM frameworks ecosystem is matured, but not to the point where we can take them to any project as I do with likes of Hibernate!!
  2. Logging is the key! Don’t overdo the documentation. If logging is perfect to the sense, every single activity is logged, it will be lot easier to debug without any help. Rather than look up SOF for everything I prefer to do it this way.

These 2 points, I feel is rather very important. I mean, whats the use of giving OBD port, when I can’t get error codes to debug? So I suggest them to improve their logging mechanism, which is a boon rather than giving a whole lot of FAQs and tutorials and putting out answers in SOF! This isn’t healthy.

Well, I maybe wrong. Maybe JS Guys like it this way, but I don’t. And if something works for me out of the box,  nothing matters. Not even support. I stayed with JDK 6 until a year ago. Yes, that’s cold, but that’s how it works. So I wish, Caminte and Sequelize step up their game and bring some new features along with proper way to debug.

NOTE : This was my short term observation. Opinions may change, once I get hold of these FWs and this is not intended to berate anyone or any Entity(Pun intended!). This post gives you a brief of how noob friendly these FWs are! And for me, if a noob can do it in a short time, it tends to be a better one(Not applicable to all things!).