News for hackers. Stuff that matters.
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?