103 points · by keva161 · 13y ago · 93 comments
I'm not trying to be hostile, but you've got to understand that Mongo is most certainly not a joke, has lots of support, and is a very appealing option in a number of cases.
What cases do you have in mind?
Those are two areas in particular where I would first look to Mongo.
I have yet to experience MongoDB in a large scale production environment and the common pitfalls often cited, but let's face it - If you're Start-Up has scalability issues, it's prob a nice problem to have.
Based on my personal observations, i suspect the lack of adoption is because founders are thinking about scale prematurely - which is rather Anti Lean Startup and Anti-Pg anyway.
I've had MongoDb running on my laptop in less than 5 mins and used it locally for multiple projects without issues.
The kind of problems you mention probably occur on very heavy use but i've never witnessed it myself.
For small scale stuff and getting up and running quickly, i've not used anything as convenient as Mongo
Note: I'm on Windows.
Also consider MongoHQ - They have a really good Start-Up package.
What I've read about MongoDB, it wants to use all the memory it gets. So it's only usable if it is running on its own server. (And in the beginning of MongoDB it had to be 2 servers if you didn't want to lose data.)
Is this a false information again? Am I falling for anti MongoDB FUD again?
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
instead?
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.
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.
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.
@cuttooth and @PommeDeTerre, since you both are pushing the "JS is a flawed language" angle, what do you find are its greatest flaws?
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...
As for its "greatest flaw", I think that may be the JavaScript community, and the general attitudes within it.
There is, unfortunately, a very high degree of ignorance within the JavaScript community. There are far too many JavaScript programmers who only know JavaScript, or an equally-horrid language like PHP. Having such a limited world view, they don't realize how inherently bad their tools are, and they don't realize how much better they could be.
This ignorance has many side-effects. One big one is that we see a near-complete lack of improvement of the language itself. Any changes that have happened never really address any of the serious flaws with the language.
Another side-effect is that we see JavaScript used in ways that it shouldn't be used, in places that it shouldn't be used. Large browser-based applications and server-side applications (of any size) are two good examples. Asm.js is another. Emscripten is yet another.
There are various other issues with the community, their attitude, and their ignorance, too. We could go on for a very long time about this.
The JavaScript community ends up earning a lot of animosity, if not outright scorn, from those developers who have experience with many programming languages, and who have spent years, if not decades, developing production-grade software in a much more sensible, proper manner.
I don't think that anyone would really care if JavaScript users used it solely as a hobby. But the moment they try to use it professionally, for real-world software systems, they'd better be prepared to defend themselves and their technological choices. They can't bring their amateurish programming language and ignorance to the table and not expect to be treated harshly.
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.
Just because the query language is JSON-esq and has a javascript shell, it's therefore "Javascript" and a target of derision and scorn?
If I want to move forward I can switch to mongoose or move over to postgres and node-pg.
You can easily find relatively mature MongoDB drivers from the start for new languages, but don't hold your breath for PostgreSQL. See Rust.
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.
So are many other newer languages and frameworks. See vibe.d (http://vibed.org/) for D which has only database drivers for MongoDB and Redis.
The one thing we do differently is that we're using fibers and Common Node (https://github.com/olegp/common-node), as well as Stick (https://github.com/olegp/stick) instead of Express. This lets us write complex business logic with less code and without having to worry about explicitly handling errors, since we get to use exceptions.
`mean create myapp`
I deeply encourage anyone who wants to break, replace, remove, add any part of this project to go ahead and do so! Like any recipe this is just our serving suggestion.
I'd love to see an ember fork!
Two other nice packages:
Nodemailer - for emailing - npm install nodemailer
Moment.js - for time/date formatting, and a ton more (manipulation, etc) - npm install moment
It also just informed me of the app.param api in express. I had no idea.
Their reasons were the database is easy and it "scale".
The real reason why they chose it because they think SQL is too hard. Really, they were self taught programmers that couldn't bother to learn SQL and jump straight to NoSQL hype and the fact it was "easy".