In what use cases does mongo kick postgres's ass?
To the two points you mentioned:- semi-structured input can be saved as hstore type or as json type;
- and for flexible jobs, you can use pretty much any popular language - PL/R, PL/Python, even PL/C if performance is really critical.
Agreed on the first point (but I'm not sure you get exactly the same type of flexibility in all my use cases - I'll have to make a closer comparison).
For the second point, well not having to handle the schema for ETL jobs is sometimes fairly useful and removes a lot of cruft, that was part of my point (those ETL are code-based, only relying on MongoDB as a flexible store).
Besides, SQL sounds more high-level than map-reduce to me.
Here is a presentation (slides + video) I gave about a Ruby ETL, for instance. It illustrates the typical use cases I run into.
If you need to store multiple forms types, it gets hairy very fast.
MongoDB allows to query inside the data (which is not a blob in that case).
A long while back I built a somewhat complex survey app: I can confirm it's fairly more complicated to handle with a RDBMs, compared to a document store.
so you could have:
create table form_results (
id serial primary key,
data json
);
http://pgeu-plv8.herokuapp.com/ has more information.You can apply full text search on it, but that doesn't tell you if you're matching on a key or a value.
No surprise to see the GIS part of MongoDB is built-in instead of an extension of some kind. I know a couple of people who used PG without even knowing there was a GIS extension.
- dealing with semi-structured input (forms with some variability) and storing as a document, all while being able to query across the data
- used as a store to provide very flexible ETL jobs (with ability to upsert, filter/query, geonear etc)
For those situations, I would definitely use MongoDB again. As a RDBMS replacement, I wouldn't use it today.