Answer the question
In order to leave comments, you need to log in
How to organize and store the config for each user in order to do something one or more times?
When authorizing a user, it is necessary to show the functionality that he has not yet seen, one or more times.
For example: we made a new modal window with new functionality, and you need to show it to everyone, then when you close the window or refresh the page, do not show it anymore.
Or something else has been added: some block, which, when a person has read it, should no longer be shown.
How to store states for each item. There was an option to make fields like: user_id, par1, par2. There was an option to store an object for each player in the form of json {par1: false, par2: true}. But how to update these objects for each user when adding functionality? You can add an object with the par3 property through a request to everyone and the new functionality will be added, but then everything will be re-viewed.
Answer the question
In order to leave comments, you need to log in
Are you talking about a browser? So store in the cookie what new items have already been shown to the user from those that have appeared in the last, say, three months. Just a list of IDs on one line. Why is it in the database?
I did through the option {par1: false, par2: true}
Of course, I can add another object with the par3 property through a request to everyone and the new functionality will be added
Already did something similar. If you always show in order, then it is not at all necessary to store everything with everyone.
If all new features have IDs and are shown in order, then it is enough to store with each user the ID of the last viewed one. And no growth.
There is also a limitation, of course, you can only show as the ID increases, but you need to store much less.
How to properly store such data and remain scalable?
json field. And you need to fill in not those that he did NOT see, but those that he saw. I saw - added the key. You can even json array.
No separate tables are needed, this is complete nonsense.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question