Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question

closed as not constructive by Jimmy Hoffa, MichaelT, Martijn Pieters, Dynamic, gnat May 16 '13 at 6:21

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 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.

share|improve this answer
    
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... –  Gabriel Smoljár May 15 '13 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. –  Jonathan Rich May 15 '13 at 20:31
    
Sorry about the typo, I meant ODM. –  Gabriel Smoljár May 15 '13 at 21:47

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.

share|improve this answer
1  
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 –  Jimmy Hoffa May 15 '13 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). –  Bill Leeper May 15 '13 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 –  Jimmy Hoffa May 15 '13 at 20:08

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