11 ms·
What's the deal with MongoDB and the node.js community? I don't find non relational databases that enticing and there are javascript drivers for postgres [1].
by wasd 13y ago
What's the deal with MongoDB and the node.js community? I don't find non relational databases that enticing and there are javascript drivers for postgres [1].
[1] https://github.com/creationix/postgres-js https://github.com/creationix/postgres-js
- cuttooth 13y agoJavaScript "developers" feel the need to not use any other language than JavaScript, so they decided to shove it into as many unnecessary places as possible, even if their code more frequently ends up being an unmaintainable mess with no noticeable performance gains.
- landongn 13y agois the "developers" dig really necessary? MongoDB is fine-- at least until you start seeing significant scale, and even then, it's going to run into the same issues as everything else would if you hit it too hard, too often. Just because the query language is JSON-esq and has a javascript shell, it's therefore "Javascript" and a target of derision and scorn?
- jaredsohn 13y agoI don't feel like you addressed the parent post. It was asking why people use mongodb instead of JavaScript bindings for PostgreSQL.
- muriithi 13y agoI have used both. I find it easier to iterate using mongodb because you do not even need a schema to begin with. If I want to move forward I can switch to mongoose or move over to postgres and node-pg.
- cnlwsu 13y agoI think very few javascript developers only know javascript. This some kind of late 90s C++ elitism or sarcasm?
- PommeDeTerre 13y agoNo, I think it's just the unfortunate reality. The problem with your argument is that those who know programming languages other than JavaScript end up seeing its flaws extremely clearly. Such people won't willingly subject themselves to something that is so inherently broken, especially given that they're aware of the alternatives. Many would feel quite ashamed to associate themselves with it in any professional manner.
- outside2344 13y agoHave you tried development with node.js and in particular npm (node package manager)? I used to have the same thoughts about JavaScript. It really is a new world with these two things - and that is coming from a Ruby background.
- adeaver 13y agoPlenty of people who know multiple languages use Javascript every day. Of their own free will. Because they want to. What is it about JS that you find so broken that you have such animosity? I for one know C, Perl, PHP (not just Wordpress either) and even Coldfusion. I'm currently learning Python because I want to. And I chose to work in Javascript as my main language because I want to. I have no real issues with scoping, am comfortable with the fact it has no 'class', have a good handle on the fact that everything (including functions) is an object. It is flawed? Yes. But then again there isn't a single language in existence that isn't.
- saraid216 13y agoSome of us want to get things done rather than sit in an ivory tower being pompous. The notion that a person is not a developer simply because they expanded their knowledgebase to include a language you dislike is asinine.
- adeaver 13y agoYou are so right. Why try new things and test new ideas. Everything we have is perfect as it is! No need for a car, walking will get you there! We don't need moving pictures, books are fine! Do you even know anyone that works in Javascript? I happen to like JS but pull out PHP or Python or whatever I need to get the job done when I have to. And I'm not an exception.
- PommeDeTerre 13y agoI've seen your flawed argument used more and more often around here lately. It's pretty disappointing to see. Somebody speaking out against deeply broken technologies or bad ideas that have received a lot of hype lately does not mean that such a person "hates progress" or is "resistant to change" or any utter nonsense like that. Likewise, adopting so-called "new ideas" or "new technologies" does not necessarily mean that real progress is actually being made. JavaScript and NoSQL, for example, are generally regressions in most respects, even relative to 1990s- or 1980s-era technologies. True progress happens when we move beyond our current abilities. It is not progress in any sense when we start using inferior programming languages or databases, for example.
- deleted 13y ago[deleted]
- 10098 13y agoNoSQL is a regression in a sense. Or, if you prefer, a conscious trade-off. Providing the same guarantees as traditional relational databases becomes difficult at scale, so you trade some of the features for higher scalability. For example, you can have a very highly available, distributed key-value store, but with no transactions across multiple rows, no query language, no schema, no indexing, etc. If you think about it, the only real (and most important) advantage of NoSQL databases is that you can make them scale. If only we could make relational databases work like that, I'd happily shove all the data into a store supporting schemas, a powerful query language and ACID transactions.
- drhayes9 13y agoThe "developers" dig seems unnecessary. @cuttooth and @PommeDeTerre, since you both are pushing the "JS is a flawed language" angle, what do you find are its greatest flaws?
- cliffu 13y agoThe opinions of one who writes "Javascript 'developers'" are probably not worth knowing. Javascript has stupid scoping rules, and some other obvious flaws, but it's not flawed as in unusable, and it's certainly not flawed as in "'developers'".
- drhayes9 13y agoMaybe, but dismissing people doesn't sit right with me. Not to get to Yoda-y, but the anger here is real and deserves some scrutiny.
- 10098 13y agoI can tell you why I dislike programming in JavaScript (those aren't necessarily faults of javascript itself): 1. Complex code usually contains some horrible callback spaghetti, which is not pleasant to debug at all. 2. General flakiness, or, as I call it, the "WTF happened?" syndrome. I run into this all the time. Change or add something - suddenly you find the web page broken. Okay, so there's a bug somewhere. Click developer tools - console... blank. No error messages, nothing. Just you and the broken web page. Just the other day I was trying to integrate a select2 input field into some angular.js-powered page and ran into all kinds of weird issues. But why does it even have to be a problem? Why can't I just stick a new control into a web page with a click and maybe a few lines of code? Hey, remember those things called "Visual Basic" and "Delphi"? UI programming with these was a blast, all the controls looked and behaved the same across all applications. And then there was ActiveX. The idea behind ActiveX is almost futuristic compared to the shit we have to put up with. 3. Type system. Made a typo in a variable name? Bad luck, Javascript will introduce a new variable and you'll have fun chasing a non-existing bug. Oh, look, here's a function: "function foo(param)". I wonder what does it do? Unfortunately, the previous maintainer has not left much comments, so now I have to dig through the implementation to find out what the parameter should be and what values the function may return. These are my main issues with javascript. I hope sometime in the future we'll throw out the whole Javascript/HTML thing and start writing web application front-ends in a language that is more geared towards UI programming. I can imagine having a nice declarative language (instead of HTML) to describe what the interface looks like, and a statically typed imperative scripting language to describe UI behavior. It would also be awesome if these technologies allow for painless integration of independent UI components (a bit like ActiveX controls). But those are just dreams...
- veemjeem 13y agoProbably because mongoose is so well written, it feels inferior to use another kind of ORM library. I'm guessing nobody has written something as good as the activerecord library in the ruby world for node.
- wasd 13y agoI just found node-postgres and it looks okay. Active development and issues look like they're not major. Do you have any experience with it? https://github.com/brianc/node-postgres https://github.com/brianc/node-postgres EDIT: Whoops, its clearly just a client and not an ORM. How about https://github.com/dresende/node-orm2 https://github.com/dresende/node-orm2 instead?
- rpedroso 13y agoYou can't really compare node-postgres and Mongoose. The former is a simple Postgres client, while the latter is a fully-featured ODM.
- aroman 13y agoI mean you're kind of trying to say "Why not X?" The answer is X would probably work fine, but Mongoose got there first, set the standard, has lots and mindshare, and is very well written and tested. Could most everyone use D instead of Go or Java? Yeah, probably they could. Is one significantly objectively better than the others? Probably not. I've used Mongoose extensively and it just works. It feels really idiomatic and has a lot of love in the community. I don't have a reason to look anywhere else.
- coderzach 13y agoIt's nice to be able to get up and running and just throw documents into a database without having to specify what that data will look like up front.
- wasd 13y agoI guess that makes sense but do most people who use node.js use mongo in production or just as a scaffolding tool?
- veemjeem 13y agoWho the heck just uses mongo as a scaffolding tool? I don't know anyone who does that.
- outside2344 13y agowhat he meant (i think) is use MongoDB in a lean manner - which is to say, try to get something off the ground, and if it takes off, switch to the most appropriate DB then (which might be Mongo). I think this is the killer use of Mongo IMO.
- wasd 13y agoYeah, this is exactly what I meant.
- stesch 13y agoMongoDB is used in almost every community. Especially for new languages. You can easily find relatively mature MongoDB drivers from the start for new languages, but don't hold your breath for PostgreSQL. See Rust.
- PommeDeTerre 13y agoI'm not sure that Rust is really a good example. While promising, the language itself and its standard library are still immature and subject to a huge amount of disruptive change on an ongoing basis. I've had some experimental code I wrote in Rust become essentially unusable after only a few months due to significant language and standard library changes. I sure hope that somebody wouldn't spend time on a PostgreSQL library for it until the language itself becomes more stable. They'd be wasting a lot of time and effort if they did try to write such a library now.
- stesch 13y agoRust is a perfect example: http://blog.mongodb.org/post/56426792420/introducing-the-mongodb-driver-for-the-rust-programming http://blog.mongodb.org/post/56426792420/introducing-the-mon... So are many other newer languages and frameworks. See vibe.d (http://vibed.org/ http://vibed.org/) for D which has only database drivers for MongoDB and Redis.