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

And other regular RDBMS like MariaDB and MySQL have much the same functionality. I store JSON in RDBMS all the time.


interesting - i never knew that. I use postgresql, so dont have first hand knowledge, but i saw this

https://tableplus.io/blog/2018/09/mariadb-vs-postgresql-a-qu...

> JSON support: PostgreSQL supports JSON and JSONB while MariaDB doesn’t. It supports an alias for JSON instead, which is a LONGTEXT column.

Even the proposed json column, is not indexed - postgresql jsonb is indexed and queries fast.


Yeah MariaDB got 'dynamic columns' first, which iirc supported key values but not arrays, and then MySQL added a more complete 'json' data type, so the exact functionality differs by flavour and version.

The postgres support is simply nicer to use and more powerful, e.g. the indexing.

But if your RDBMS is any fairly-recent version of MariaDB or MySQL, you can use JSON too.

Of the top of my head, the thing I find most griping about the MySQL syntax is you have to do

    thing->>"$.key"
instead of postgres-style

    thing->>'key'
Whereas what I really want to be able to do is

    thing.key
But most of the consumers of these modern 'dynamic columns' are apps and then it all really matters less if you don't spend all your days at the sql prompt writing stuff by hand.


Didn't PostgreSQL get hstore before MariaDB got dynamic columns?


Yeah I seem what I wrote could be ambiguous, but in that first para I was meaning to compare MariaDB and MySQL, not claim that MariaDB beat PostgreSQL.


Ntoe that MySQL's `JSON` type is using an efficient binary storage scheme which allows fast lookups etc. https://dev.mysql.com/doc/refman/8.0/en/json.html

My favorite MySQL JSON feature probably is JSON_TABLE which converts a JSON document on the fly into a table which can hen be processed using SQL features. https://dev.mysql.com/doc/refman/8.0/en/json-table-functions...

(Disclaimer: I work for Oracle's MySQL Engineering team)




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

Search: