I have a requirement to design a table which almost looks like a 3 dimensional requirement.
For example,
- There are "infinite" varieties of Dinosaurs.
- All the Dinosaurs will have some common set of features (name, years since existence on earth, weight, family name, etc.,).
- There will be some specific features which are sometimes unrelated to each variety. Each such feature is identified with a "name"="value" pair. The "name" is something like the name of a feature (like may be horns on head, the voice frequency etc) and the "value" could be the value of the feature (like 3 horns on the head, some 10hz voice frequency etc.,).
As per the requirement we can create a table X with common features like columns referring to cid, name, years since existence, weight etc.,. And there there could be another table Y with just columns (uid, name, value) where cid could be bound used for the uid.
But the fact that, the number of rows in X would be enormous (trillion+, we might not have so many dinosaur families, but that is just an example). Similarly, the name=value would be several hundreds per entry in table X. This would increase the number of rows in table Y.
Since, the feature "name" is also "infinite", we cannot create a table with fixed number of columns, like column per feature unfortunately because that would be like dynamic columns.
One idea would be to have two more columns in table X, where one column can consist of all the features ("name") as comma separated and the other column can consist of all the "values" in comma separated. But I know this is a very bad design.
Could there be any better solutions for this requirement?