1

I am working on a project with the following data structure :

datamodel

A user need to be able to perform personal filtering on a given project, and this filtering needs to be saved (for each user/project pair). For example, he can choose to filter based on attribute1, attribute 2.

For storing such user settings, I did use this schema:

enter image description here

and I can have for example a setting for attribute1 filtering, and in my user_setting table store the corresponding value.

My problem is that the user needs to be able to perform a manual filtering on the objects (i.e. filtering them with checkbox). That would result in choosing objectIDs among all the object IDs.

My first thought was to store them in setting_value as comma separated values, but I read that I should not denormalize (note that there can be a lot of objects, and a lot of projects).

Is it a good approach or should I rethink my user setting storage approach?

mustaccio
28.7k24 gold badges60 silver badges77 bronze badges
asked Jul 29, 2021 at 13:52

1 Answer 1

1

Since you need to use the IDs of manually selected objects to query those objects, it would be counter-productive to store them as a single column value. I would probably choose to store the manually selected object IDs in their own table.

answered Jul 29, 2021 at 14:39
2
  • Good point about the fact that I will need to query the IDs, so my table would be something like |id|project_id|user_id|selected_object_id| resulting in one row for each selected ID, that would result in a very large table since there could be a lot of users/project combinations, is that a problem regarding any performance issues ? Commented Jul 29, 2021 at 14:52
  • 1
    Performance concerns can only be answered by simulation testing. "very large table" is a subjective measure. Commented Jul 29, 2021 at 14:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.