There are two options for organizing the database structure. The first option is to create one table with 4 columns (id, type, key, value). The second option for each type is to create your own table, where the key will be the column of the table.
The problem is that in the first version of the records in the table may be over 100,000 (although it is more flexible), but in the second case there are about 100 tables (although this is not a problem, the table is generated automatically)
More visual scheme:
Option 1:
ID | type | key | value 1 'cat1' 'key1' 'value1' 1 'cat1' 'key2' 'value2' 1 'cat1' 'key3' 'value3' 2 'cat1' 'key1' 'value4' 2 'cat1' 'key2' 'value5' 2 'cat1' 'key3' 'value6' 3 'cat2' 'keyn' 'valuen' .... Option 2
Таблица cat1 id | key1 | key2 | key3 1 value1 | value2 | value3 2 value3 | value4 | value5 The question is which option is more optimal. Are there any global performance differences? What can be used to improve performance? I will be glad to any advice