So I hope my question here isn't too vague.
I'm currently thinking about how to model a bike with all its parts and their relationships to each other within a database.
I haven't chosen a specific database as of yet. So it could SQL, document or graph database, or whatever else I'm not aware of.
So let's say I want to represent a bicycle. A bike is composed of various parts (or components) which all relate to each other and all have various properties.
For instance a frame can have a 135mm rear dropout, which means it will relate to a rear hub that is 135mm wide. The hub itself has 36 holes which means it can be used with a 36 holes rim, and so on and so forth. However a frame could be disc specific (it has disc mount but no rim brake mount) which means it can only take a disc hub. However a disc hub can be mounted on a frame that does not have disc mount but uses rim brakes.
I have already explore the idea of using a realtional database (postgres) with a json type and single table inheritence. As in a frame and a hub are both component sharing common properties (model, make, material, year...) stored in a component table as well as specific value (size, number of spoke holes...) store in a json field within the component table. But the problem is to represent the relationship, I could either match unique properties or use foreign keys for each rows.
So my question here is, is there a better way to do that?