Can PHP's array_push and array_pop be used instead of redis' list?
巴扎黑2017-05-16 13:14:47
0
4
1124
When making queues, for example, when queuing for product orders, we use redis' list. I think we can use PHP's array_push and array_pop instead of redis' list?
An array cannot exist between multiple requests. When a single request ends, the process ends, resources are released, and the array is destroyed. Data persistence is required
Yes, but you need to use cache to save the status of pushing and popping the stack, because the data of a single user process will not be shared with other users. You need to save it every time it changes. If you don’t need to save it with redis, then use file cache every time. All changes must be saved
An array cannot exist between multiple requests. When a single request ends, the process ends, resources are released, and the array is destroyed. Data persistence is required
Obviously not. If you can play like this, there will be no need to cache anything
php is a process, it will not exist the next time after one request. Unless you store this array in the database
Yes, but you need to use cache to save the status of pushing and popping the stack, because the data of a single user process will not be shared with other users. You need to save it every time it changes. If you don’t need to save it with redis, then use file cache every time. All changes must be saved