So, there I was… getting ready to write my own plugin to suit my own purposes; yay! Open source! As a part of that process, I began researching how other developers are modeling their data. You know, for
plagiarisminspiration kind of thing. I noticed that a lot, like nearly everyone, in their database model uses a post table and then a posts_meta table with key, value pairs stored in it. Then they store everything in meta table, perhaps, way too much. Then they loop through meta table like a greased hog at a Sunday picnic; it’s seems comical at first but then ends in tragedy. From an efficiency perspective, especially as the data set grows, isn’t this a really bad idea? For this kind of data model wouldn’t json work faster and result in a much cleaner code base as well? Additionally, it seems to compound the task of building out an API for that kind of data model.
Why are developers preferring to use a key:value pair over normalizing a table and then providing what seems to me to be unnecessary php to make it all work? Please help me understand the decision for preferring the key:value type data models or optionally explain how I’m brain dead. That will work too. As long as I have a better understanding of why decisions are being made that I would not normally make.
Please don’t use the “because that’s just the WP answer” or the “that’s the way we do it answer” without providing the context to what I may have missed.
Thanks in advance.