Monday 20 May 2013

JSON vs Foreign Keys

JSON vs Foreign Keys

I'm developing an enterprise website, and I have to define some sections like this:
I have many sections and each section have many (or one) sub-pages.
The number of sub-pages vary per section.
Each sub-page should not be longer than 2500 characters
Also, I have to use a relational database (MySQL).
I'm in doubt witch would be the better in terms of design and/or performance:
To store a JSON array, with all sub-pages as object, as a single column of the Sections table;
To create a table Sub-pages which references it's parent section by a Foreign Key.

No comments:

Post a Comment