User Settings architecture
Hey, I am very new to everything related with backend and I recently started my full stack side project.
The application will have "modules" for the user to choose from, they are stored in the DB:
and I am wondering what is the best practice/pattern to make a relation between those two tables with a requirement that the user selects multiple modules
NOTE that there will also be theme, currency etc. for the user to select
Is creating a third table like preferences a good idea? if soo how should the table look like ?
1 Reply
Just throw in a third table to link users and their chosen modules. Something like this:
This way, users can pick multiple modules without any hassle. The combo of
userId
and moduleId
keeps them from selecting the same one twice, and it all stays nice and clean in the database.