阿神2017-04-17 16:08:31
First of all, pg and mysql have some overlap in json functions, and some are unique.
In terms of common functions, pg is faster than mysql
pg has more functions to operate json than mysql
pg custom functions are relatively powerful and can be better modularized for json operations. They don’t have to be all in one sql
pg supports functional indexing, which allows you to index a certain value in json without adding or subtracting fields to the table
If you want to choose the right one, I have the following suggestions
If you have few functional requirements for json operations and the intensity of its operations is not high, it is recommended to choose the most familiar database
Everything is developing, maybe mysql’s support for json will get better and better in the future, so if it is not necessary, choose the database that you/the team are most familiar with
If you have frequent operations on json and require complex operations, pg is your only choice at this stage