Which is better, to store config data into single jsonb field or dedicate a field for each property key?
For example, this json data:
{
notifications: {
check: {
enabled: true,
In_delimiters: true,
Out_delimiters : false
},
battery_low: {
enabled: true,
battery_power: 0.70
},
gps_on: {
enabled: true
},
gps_off: {
enabled: true
},
speed_exceeded: {
enabled: true,
speed: 100
}
}
}
If I have thousands of users, each property key will be duplicated in each row, making the DB size grow bigger than if I dedicate a field for each property and store value only.
What's the advice in this case? Shall I go with jsonb and use compression? or dedicate a filed for each property?