4

I've been looking att different web stacks, mainly rails and node.js. One thing that strikes me is that while rails is often used with a relational database Node.js seem to go hand in hand with Mongodb, judging by the blogosphere.

Is there a specific reason for this? I like the modularity of node but I'm also sceptical to NOSQL. I get the feeling that if having a rdbms is important I should use rails since they seem to be a second class citizen in the node ecosystem.

2 Answers 2

2

Because they're both JavaScript. There's no other real benefit to using Node and Mongo - feel free to use another RDBMS supported by Node.

Node has https://npmjs.org/package/mysql, which will probably be less fast than Ruby's drivers (it's slower than PHP's), and https://github.com/brianc/node-postgres, which I don't have any experience with.

There is also Sequelize, http://www.sequelizejs.com, which supports postgres and SQLite, and is a bit of a clone of ORMs from other languages.

3
  • What I get from this: ORM is possible with node, but it's not as slick as with rails and DOM is possible with rails but not as slick as with node... May 15, 2013 at 20:08
  • There is nothing special about DOM manipulation in JavaScript - you can do the same in rails, just through different conventions and interfaces. May 15, 2013 at 20:31
  • Sorry about the typo, I meant ODM. May 15, 2013 at 21:47
-2

I think it has to do mostly with the cutting edge nature of both solutions, so they get talked about in the same places.

Another might be the problem domain that both are solving are similar (dealing with sets of data that may have varying properties).

Both are also used to a varying degree on projects that have a narrow focus.

Larger projects with larger data domains are more likely (but not necessarily) going to use a more robust framework and have requirements that fit better with a relational database.

3
  • 2
    Your first statement (though sounding very subjective) is relatively logical and true, the rest is just marketting handwaving, doesn't have details, and I generally disagree with, though could be persuaded if you explained why you believe those things May 15, 2013 at 16:50
  • Just speaking from experience. While it is not necessarily the case all the time, larger projects with wide scope and features are more likely to use a relational database as their primary store. I think this has more to do with the nature of the data in these systems than it does with any shortcomings or strengths in the technologies between relational and nosql databases. Larger systems are more likely to deal with structured data that is better suited to a relational database (think enterprise systems with well defined structures and rules). May 15, 2013 at 20:02
  • 1
    If it's due to the nature of the data then it must be related to shortcomings and strengths of the options, it can't be a better use case for X while not having any strength or shortcoming between the competing options that makes it better. If you want me to remove the down vote you'll need to detail in your answer (not in comments) precisely what technically makes these things so May 15, 2013 at 20:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.