Relational-JSON overlapping with association I have a composed class called sensor that is linked to a main class Node such that:


class node is linked with another node to make a communication that produce an event
class sensor can as well detect events


So I thought of putting the sensor data inside of the table node as a JSON, but the  association that allows me to detect makes doesn't apply to any schema I have seen before.

Is it a good idea to make the change that way or will that be more tricky to get the needed data?

See the full UML below; but my point concerns only the sensor.

Do you think I can convert that in R-JSON?

If you spot any place other than position that it would be suited to use R-JSON, I would like to think of the option.
If you want simple and efficient SQL statements, don't model an entity as a JSON column. Create a regular normalized table that expresses the functional dependency between the sensor's attributes explicitly.

JSON in the database is a good thing and has its applications, but modeling foreign key relationships like the one to event is not among them.