Reputation: 31
I am working with a big database in MySql and I would like to know when is good to store data in JSON format instead of creating other tables.
Thanks.
Upvotes: 1
Views: 3334
Reputation: 4168
Possible use cases for JSON format in a classic database:
SUM
, MAX
, etc.)PHP
.Upvotes: 2
Reputation: 3105
You can NOT search or index data expressed as JSON. It would be not very meaningful. It would be like a BLOB from DB's point of view.
So basically, you would just slap it into the database, and do not do anything with it? Then this begs the question whether you really need that JSON data at all?
If you are going to use bits and pieces of it more actively, then it makes sense to (at least those parts that you are interested in) get those parts out of JSON and put them in proper tables etc. That way you can search, index, relate these bits of data with others in a more meaningful way.
I hope it helps.
Upvotes: 0