Hacker News new | ask | show | jobs
by JonahBraun 3846 days ago
Interesting that he advocates MySQL. PostgreSQL can index and interact with the JSON stored in it's columns, which make it a better choice as a NoSQL replacement.

http://www.postgresql.org/docs/9.4/static/datatype-json.html

2 comments

I believe that MySQL 5.7 comes with JSON data types too.

https://dev.mysql.com/doc/refman/5.7/en/json.html

Indeed. To expand a little: it has a Json type, functions & virtual columns.

So you can extract part of a Json document and index it. The optimizer can also match Json expressions to indexes

The JSON datatype is only useful if you want to query on the blob, which is not the case in Wix's case.
But you tell to keep columns that need indexs outside of the JSON so you can query on them, which is not necessary with Postgres
It also provides validation and is often more space efficient :) the internal format also technically supports partial update, but that is not yet a supported feature. So I wouldn't suggest using text if you are not querying.
You can query on individual fields with the jsonb type