i am writing a cms system in php 5.3 on top codeigniter. The contents of the data, i have determined, it will very in size and form and i was wondering if storing the data in JSON format in MySQL would be a good choice. I need to be able to store data in a structured way, but the way it is structured, the number of subtitles will very, the use of lists, tables, or other elements may be needed at times.
I want to create a lib of tools in the end for creating different types of sites, have the lib built very modular so that u can strip it down to the minimum sized footprint for each site.
Is JSON a the right choice or would it be to processor intensive?
JSON in MySQL? No, don’t do that.
Arrays and structures are readily built from the result of a SQL query, and readily converted to JSON format (json_encode()) when needed which is not much, except when creating JavaScript.
Going the other direction is straightforward too: convert JSON to PHP arrays/hashtables (json_decode()) and use that to create a SQL query to update or insert into a set of tables.