A
A
Artem Gribkov2015-05-21 04:28:26
PHP
Artem Gribkov, 2015-05-21 04:28:26

Is it reasonable to use redis to write data from asynchronous requests?

There is an application in php, on the page there is a list of products and by clicking on the product you need to write the time of the click and a couple more data to the database.
I thought to store a key-value pair as a product id - an array with fields. I think to do all this using ajax + using php to write in redis. Many people can click on one product at the same time.
So I have never used radish or memcached, so I ask if this will be the right solution? Or can you just send a bunch of queries to a relational database?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fortop, 2015-05-21
@L1Qu0R

Radish is suitable for keeping statistics.
If some deeper analysis is planned, then periodically collect the accumulated data and save it from the radish in relational databases.
Using a memcache is not the best idea, because there data can be overwritten when there is not enough memory and you will never know what data was overwritten by new ones.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question