Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Ok, I would like to share with you an idea I had and ask you what do you think about it and possible drawbacks I'm not able to forsee.

I'm building a database for an association with many kind of datasets. Instead of creating a different post type for every data kind I thought it would be a lot better scalable and future proof to create just one generic post type and associate different metadata. The kind of metadata associated is defined by another object (let's call it "type") in which the fields and their attributes are saved as a serialized array. This array will be formed using a form editor in the front end (or creating forms in google forms and the parsing them server side).

So each post of this content type will have by default just few fields, like the date of creation, the author and edit history, and of course a bidirectional relationship with the object "type".

The rest of the metadata, as defined in "type" will be added via the front end. This way I can achieve maximum flexibility about which kind of data I want to save, and keep the database simple.

What do you think of this approach? Which impact could it have on the database as it grows? Would it be difficult to query for specific metadata since i cannot use the post type to better define the query? Something else?

If it works I could create a plugin out of it!

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.