I have a table that will have several fields, such as counties, age_groups, gender, sports, etc..
on countries I will be storing data with this format["US","CA","DK","FI","RU","SE"]
on age groups I will be storing data with this format["2000","1999","1998"]
on age groups I will be storing data with this format["M","F"]
on age groups I will be storing data with this format["soccer","hockey", "tennis"]

Is it a bad idea/practice so store serialized/json_encoded data on mysql?

Recommended Answers

All 2 Replies

Typically speaking, it is very bad practice to store serialized (or JSON) data in a database. This is big, red flag that you are not normalizing your database. Thus you're going to have dependencies all over the place, and it will make maintaining your data an absolute nightmare.

Could you paint a more complete picture on what all of this data is and how it's being used? I'd be happy to help you design better schema, but I need the bigger picture

Hi Bob,
I actually have several tables with relatioships. The thing is that i wanted to know if it was a bad idea/practice to store the data as json/serialized. (It seems so simple to code it)
thanks for your answer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.