Saving very granular user settings

I saw here a few questions about saving user preferences, but they seem to mostly relate to a fairly minimal set of preferences. I am currently working on a custom web application that should store a large number of settings, and I am struggling with how to store them.

The types of preferences that I will store include booleans for displaying specific tooltips, the location of the various content panels on the page, the pages that will be displayed after logging in, the default values ​​for certain form fields, etc. All in one, I expect that for each user there will be 50+ preferences of this type, and the data will be mostly logical and integer.

I'm not a big fan of serialization, but I'm worried about the scalability of storing each preference as a separate line. Thoughts?

+5
source share
7 answers

Serializing a lot of data is the way to go, but not for performance reasons, but because it is an aspect of the system that can see a huge amount of change. You do not need to change the database schema just because now you need to allow preference to enable advanced mode on any page or something similar.

The entity-attribute-value model that HLGEM mentions is suitable for this in terms of "simple development," but, according to her, the performance will be very poor.

, , (, , , , - , ).

+6

-attrivute-value (http://en.wikipedia.org/wiki/Entity-Attribute-Value_model), , 50 , , 50 , .

( , , ), , ( , , , , , ) , . , , , , . , ( , ), . , - .

+4

, XML "". ;)

+1

, . , ( ) , ; db-, . ( - ) , .

0

, , , , , , .. A OR B ..

, , - .

0

, ( , , , ( ..)), cookie .

, cookie. ...

0

, ( , , ). . , , (, , ). db , , , .

All user preferences are usually very static (i.e., similar to a habit), do not confuse user data that is more volatile with preferences.

0
source

Source: https://habr.com/ru/post/1713856/


All Articles