I am working on a website where user clicks on a add buttons to get information about that topic. Currently, when user clicks on any add button i store the data in a cookie. For example,
Let's say the Topics are A, B, C, D and so on.
I store them in a cookie like - A,B,X,P,Z. In other words as a comma separated list. What I want to do is backup the preferences on server in a database. This way if the user clears cookies sometime i still have the data backed up. Also, the user will be able to login on other devices with same preferences.
If I connect to the database on every user click, I will hit the concurrent maximum connections list probably. Is there some way to do it efficiently?
Is there some other option altogether? I am looking for something like feedly where user clicks on add button and the preferences are saved.