Answer the question
In order to leave comments, you need to log in
Key/value values. How to choose the best storage method?
Good day.
I'm developing a Web application (I'll skip the details) where I needed to hide real user IDs (Primary Key in MySQL) behind a fixed length string (hash). Hashes are randomly generated during registration and entered into the users_hashes table like this :
| unique_hash | user_id |
Example where I will use this:
Let's say user1 sends a message to user2 via ajax to the server. The request looks like this:
{
"from": "c1fedb2d17ca40af1c27252646d8be48",
"to": "7f5215959290e8ec6626e904d9e84648",
"message": "some message..."
}
Answer the question
In order to leave comments, you need to log in
well, store it in memcache. Only .... And what is the fundamental difference between "my id 6644" and "my id c1fedb2d17ca40af1c27252646d8be48"?
How much data/requests are we talking about?
If you have a database of less than 250-300k users, I think there is not much difference where to store it - in memcache, or in mysql, in terms of speed and load.
In my opinion, if this is not currently a bottleneck, then this is premature optimization.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question