How to make a relation database match a dynamic composition of data? I have a database which has a table that contains resources. It does not matter what the resource are, they have a fixed number of properties so perfect for a table.

I would like to have consumers that must be stored in the database. My problem, as far as I am concerned, is that these consumers consume a certain amount of resources that is not constant. Furthermore these consumers can also be Used by other consumers. 

I realize that a graph database, like e.g. TinyVirtuoso, can seem like something that is optimal, but for the moment I need it in a relational database format.

So far I was able to come up with the following ideas:


If I were to make assumptions about the number of resource a consumer can have.


Make a table with the maximum number of resources for each consumer,

If no assumptions for the number of resources, then I suppose just a normalized design will have to do.


So I would like to know if there is a smarter way to do this, or this is just about it.
I'd go for the normalized design, mainly for readability and maintainability reasons.

Looks like you have n:m relationships all the time, then i'd use

Resource(key,p1,p2,...,pn)
Consumer(key,p1,p2,...,pm)
Consumer_Resource(resourcekey,consumerkey,...)
Consumer_Consumer(consumerkey1,consumerkey2,...)


This is a tried and tested way to go about such a scenario, and will be understood by lots of database folks.