S
S
Spoon in the brain2019-07-09 21:39:43
MySQL
Spoon in the brain, 2019-07-09 21:39:43

How to store data from the database of the user who came to the site?

Good evening, I want to create something like an array that will store data about an authorized
user, I thought to do all this using a class, but then I asked myself the question - What if several users visit the site at once?
Why do I need it? For that case, if I need the name of an authorized user, then I did not access the database every time.
I have a sketch with a class but I understand this is a bad idea.
How to implement such functionality?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-07-09
@vessels

In order not to access the database every time, you need to use caching. And in order to preserve the possibility of horizontal scaling of the site, organize caching not in the process memory, but on something like memcached.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question