B
B
baladoda2016-07-28 16:40:48
MySQL
baladoda, 2016-07-28 16:40:48

How and where is it better to store user data?

The site has a friends module. (add remove from friends)
You need to display the number of new friend requests all the time.
How and where is it better to store user data?
I think to store in memkeshe, with each new request to increase the counter. Is it right? No?
P/S development is done on yii2

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mitaichik, 2016-07-28
@mitaichik

If we are talking about high loads: Memkesh loses data on restart. Here, either store in the memcache and fill them again when the system / memcache is restarted, or store them in redis (I would do this).
In general - anywhere you can, you can at least in the same user table in MySQL - the main thing is that there is enough performance.

D
DuD, 2016-07-28
@DuD

Depends on scale. You can make a table in the database with requests to friends. Delete from it applications that are accepted or rejected. In principle, subject to indexes, it should work quickly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question