Answer the question
In order to leave comments, you need to log in
Where is the best place to store user settings?
I have a Rails application with over 50 user options (timezone, privacy and display settings). Where is the best place to store them? In one table with basic user information or in a separate table? What is the best practice?
I am also considering placement in Postgres hstore.
Answer the question
In order to leave comments, you need to log in
If the settings are stored in the same table as the user and there are a lot of them, then this is an extra cost when swapping an object from the database in cases where the settings are not needed. For example, the user twitches each page in order to check his privileges, while in the load you also pull out 50 parameters and create objects for them.
Plus hstore and fields with json - no need to change the database schema when changing the composition of the parameters.
According to hstore: minus - binding to PG, plus - performance and they promise that in the next version they will add a full-fledged search and indexing by fields from hstore
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question