V
V
Vladislav Shkaev2016-07-27 16:08:35
MySQL
Vladislav Shkaev, 2016-07-27 16:08:35

PostgreSQL or MySQL to work with json data?

I am making a site with music, with ajax download of playlists, text search and various sortings.
I just can’t decide on the database, NoSQL (MongoDB), MySQL, PostgreSQL.
So far, I’m thinking about PostgreSQL since it can be used like NoSQL, I’ve never worked with it, after reading a lot of articles I still don’t understand if it’s possible to store audio files and get them from the database in the form of json format, or rather it’s advisable at all.
I see no reason to receive data from the database as a php array and serialize it to json to work with it.
Actually, the question itself is whether it is possible to store records of thousands of audio files in PostgreSQL as a json array as in NoSQL, and then get them as a json array or store them as in a relational database but receive them as a json array.
And what problems can be with search, and sortings.
Actually, the task is to get json from the database and not a php array, and so that in time it would not take more than at the application level to serialize the php array into json.
Maybe it’s not advisable to store it as json at all, and is it easier to serialize a php array into json at the application level?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Optimus, 2016-07-27
Pyan @marrk2

In postgre, it seems, since version 9.4 there is a search for json, and in mysql there is not even a normal field for it. In my opinion, the answer here is obvious.

U
un1t, 2016-07-27
@un1t

Store audio files in json format in the database. Yes, you, my friend, are an esthete.
Whether it's muscle or postgres, it's a bad idea.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question