Answer the question
In order to leave comments, you need to log in
How to design a database with a variable number of parameters?
For a long time I didn’t deal with the database, and I only knew the basics, now there is a need to design with an unknown number of parameters, and with the possible further addition of these parameters.
As far as there was enough residual knowledge, I did, but I'm not sure, an expert assessment is needed, and if done incorrectly, a kick in the right direction.
the table shows the expectation from this database.
Answer the question
In order to leave comments, you need to log in
There are two ways:
On some RDBMS, the light did not converge like a wedge. Look in the direction of nosql, it seems to me that it will suit you more.
I recommend looking towards EAV. But!!! Watch very carefully. There is a very large pile of goodies and about the same bunch .... hmm .... not goodies. Choose only for you.
And I'll add here a link to a very similar discussion:
How to store abstract data models in relational databases?
By the way, try to honor your question. Perhaps, if there are few of these most unknown parameters, then the best way would be to simply expand the plates.
In the direction of EAV, you need to look if you have a quantity and the parameters themselves can differ greatly from object to object. And these parameters themselves can appear spontaneously at the request of your users.
I also highly recommend considering a compromise option in which you will use the classic structure of fields and tables. And somewhere near it, an EAV structure will be attached to it for experiments with fields. In this case, the main load will be on classical structures, and all experiments with additional fields will be essentially separate.
If any of the experimental additional fields later becomes very necessary and everything necessary, then no one bothers to refactor the database structure and transfer this field to the main tables....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question