News for hackers. Stuff that matters.
Re:Why You Should Never Use MongoDB by camus2 on Monday November 11, 2013 @03:57PM (#6713973)
> Being ignorant of SQL and attracted by the "flexibility" of schema-less data stores powered by javascript is definitely the wrong reason to look at Mongo.

It's usually the only reason. And 10gen were good at marketing it.

Re:Why You Should Never Use MongoDB by chadcf on Monday November 11, 2013 @06:22PM (#6714806)
I used it for exactly one production app and it was a huge success. The reason I used it was because the data we needed to represent was actually a document, in this case a representation of fillable form fields in a pdf document. The basic structure was that documents had sections and sections had fields and fields had values, types, formatters, options, etc.

Initially trying to come up with a schema in SQL was somewhat painful as what I was really looking for was an object store. Switching to mongo gave me a way to do a very clean, simple solution that worked quite well for the problem at hand (representing pdf forms). That said, we also played it very safe and used mongo for only the document portion, with every other part of the system being in an sql database. But for the doucuments mongo worked really well as a basic object store without the complexity of something like Neo4j.

Re:Why You Should Never Use MongoDB by tensor on Monday November 11, 2013 @07:18PM (#6715039)
Of course, a better choice now would be to use PostgreSQL's new JSON support. Postgres has also had XML document types for a long time, though I'm not sure of their indexing story.

If you don't need indexing into the document, you can easily just store it as serialized bytea data. I've done this quite frequently and it works wonderfully.

Re:Why You Should Never Use MongoDB by threeseed on Monday November 11, 2013 @07:51PM (#6715160)
Sorry but PostgreSQL's JSON query syntax is insanely complicated compared to MongoDB.

And that is a big deal for a lot of developers.

Re:Why You Should Never Use MongoDB by tensor on Monday November 11, 2013 @08:07PM (#6715216)
I just took a look, and if I'm getting this right, it looks about as simple as it gets:

SELECT json_data FROM people WHERE json_data->'age' > 15

vs

db.people.find( { age: { $gt: 10 } } )

Personally, I prefer the postgres syntax. It's much clearer. I also don't buy your claims below about performance. Can you provide a real benchmark? Are you running with the safeties off meaning you lose data?

Re:Why You Should Never Use MongoDB by dbcfd on Monday November 11, 2013 @09:00PM (#6715392)
What is the syntax on finding an array value matching some key? E.g. given a user with field "favFoods":[String], how do I determine that pizza is in there?
Re:Why You Should Never Use MongoDB by jessedhillon on Monday November 11, 2013 @10:14PM (#6715627)
select ... where "pizza" in person -> favFoods
Re:Why You Should Never Use MongoDB by jessedhillon on Tuesday November 12, 2013 @03:29AM (#6716501)
Sorry I'm stupid, I was thinking Python

select ... where person -> favFood in ("pizza")

Re:Why You Should Never Use MongoDB by gfodor on Tuesday November 12, 2013 @01:59AM (#6716289)
Your ORM will give you whatever syntax is natural, eventually.
Re:Why You Should Never Use MongoDB by idProQuo on Monday November 11, 2013 @07:11PM (#6715002)
For all the talk about how "MongoDB totally has SOME use cases", I've never before heard of a use case where it would be unambiguously better to use a document store. Thanks for explaining that so well.
Re:Why You Should Never Use MongoDB by threeseed on Monday November 11, 2013 @07:50PM (#6715156)
I've used it well in the past as well.

MongoDB was 5-10x faster than PostgreSQL, Cassandra etc.

If your domain model is structured like a document then MongoDB is a pretty great fit.

Re:Why You Should Never Use MongoDB by leccine on Tuesday November 12, 2013 @04:37PM (#6721351)
Even if it is better, why Mongo? Why not Riak?
Re:Why You Should Never Use MongoDB by yayitswei on Tuesday November 12, 2013 @12:58AM (#6716122)
In my opinion, datalog (via Datomic) strikes a good balance between schema flexibility and queryability. It's my preferred way of working with data now, after using Mongo for a year (I was also initially attracted by the flexibility of schema-less data stores).
Re:Why You Should Never Use MongoDB by mattkrea on Monday November 11, 2013 @05:31PM (#6714570)
I think a lot of people (at least in the Node community) love the interfaces provided for it and specifically Mongoose which allows you to enforce a schema and thus relational data.

I'll admit that I originally got into it because I didn't really know SQL and I'm still not very talented with it but for example.. Joins in Mongoose? Say there is a comment.. this comment has an author. If that author is type ObjectId when I run a query I can do this:

model.comment.find({_id: <some id>}).populate('author').exec(e, result) { // author will be populated with that author's data instead of just the ID }

Re:Why You Should Never Use MongoDB by camus2 on Monday November 11, 2013 @09:19PM (#6715465)
I use mongodb only when i have to write an app in Node. Not because it's the better solution , but because mongoose is the only library that deals with data that is mature on npm. The rest is beta at best and drivers for RDBMS are not mature enough.
Re:Why You Should Never Use MongoDB by hoffer on Tuesday November 12, 2013 @12:52PM (#6719387)
The mysql driver on NPM is indeed mature. Been using it with out issue for a couple years now in a large app. https://npmjs.org/package/mysql
Re:Why You Should Never Use MongoDB by mattkrea on Monday November 11, 2013 @11:49PM (#6715909)
I had thought the mysql drivers were all more mature or is it that you lean more toward postgresql?