Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Why not use PostgreSQL instead? It supports a JSON document data type natively.

Yes, that's the thing, it's just a field type. It's not really that different than dumping your JSON in a TEXT column. MongoDB is fun because it's truly JSON - BSON - so you don't have to run migrations, you can store complex documents, and have a more object oriented way of storing your data than SQL.



You should probably read the Postgres documentation [1] before you make erroneous claims like this. Postgres JSON fields can be destructured, queried, and aggregated sufficiently to cover at least the 90% cases in MongoDB usage.

I'll grant that Postgres probably isn't as much fun as Mongo, what with all its tiresome insistence on consistency and reliability. I would, however, argue that quantity of available fun isn't really a figure of merit here.

[1] https://www.postgresql.org/docs/10/functions-json.html


> It's not really that different than dumping your JSON in a TEXT column

That was true of the initial "JSON" type support.

It is very much not true of the "JSONB" type, which was added in 2014 as part of Postgres 9.4. JSONB uses a binary serialization that supports efficiently selecting into JSON documents, putting regular BTREE indexes on specific fields inside the documents, or even putting Elasticsearch-like inverted indexes on complete JSON documents.


This is so not true that it hurts. Postgres jsonb is highly queryable.


It's completely different than dumping json into a text field...

Read the docs, you can do a lot of fancy JSON stuff in plain ol' Postgres. It's really powerful and guarantees your data.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: