Which is a good database schema design by considering the performance and long-term large records?
Database: Postgres
I have two ways to design the table structure:
- Use a JSON column
- Go with a foreign key reference table?
Option 1: JSON column example,
Table 1: Case (Keep all the Cases)
Table 2: Tags (All the tags will be stored in this table)
Option 2: Have a Reference table
Table 3: Tag_Case_Mapping
Should keep different records for each tags under the same case id.
I need to display tags that are associated with each case in UI, so have to write LINQ join query to display each cases and its respective tags. I can make it in both the way, but I curious about the way which is database design approach in terms of considering the performance.