Answer the question
In order to leave comments, you need to log in
How to organize the database structure for electronic journals?
Hello!
I need to create ezines (tables) with the following features:
Answer the question
In order to leave comments, you need to log in
I would start thinking with the question "why is a relational database here and what is actually required of it?".
If you don't know the answer, take a closer look at the databases specially designed for storing documents.
Theoretically, json in a separate field breaks data atomicity. If you're going to store them this way, then you probably don't need a relational database.
The second option for relational databases is quite usable, the load depends on the hardware on which the DBMS + caching, indexes will work, that's all.
If you want to follow the relational path, in my opinion, it is better to do this - store journals (PK journal_id, name) in one table, journal fields in another (FK journal_id), and field values without json (FK field_id) in the third. Relationships are one-to-many everywhere - one log has many fields, one field has many values.
Your version is also working, but there is a small minus - adding fields will be done through alter table, as far as I understand.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question