The ranking function of PHP is briefly described as follows: One user system has experience, points ,... I want to rank the above N types of values, such as the overall ranking and today's ranking, the overall ranking of users and their friends, and the conditions for today's ranking: 1. the number of users is currently about 2 kW and continues to grow. 2. the top users are listed. 3. each user on the list needs to display whether the ranking is increased, decreased, or equal to the previous ranking. optional: redis, memcache, mysql script: php-PHP ranking function, ideas
Brief description:
One user system
Users: experience, points ,...
I want to rank the above N types of values, such as the overall ranking and today's ranking, the overall ranking of users and their friends, and today's ranking.
Condition:
1. the number of users is currently about 2 kW and continues to grow
2. Top 1 W names
3. each user on the list needs to display whether the ranking is increased, decreased, or equal to the previous ranking.
Optional:
Redis, memcache, mysql
Script:
Php
------ Solution --------------------
Because
3. each user on the list needs to display whether the ranking is increased, decreased, or equal to the previous ranking.
Therefore, you must place the query results in the table.
The next step is very easy, just construct a query command on demand.
------ Solution --------------------
Use REDIS ..
The sorted set type stores uid and ranking, and the uid performs the score.
Create another hash type, store the specific information, the last ranking, increase or decrease, and so on.
------ Solution --------------------
The landlord. What are the 2KW data stored? How can I set a reply reminder for CSDN !??
------ Solution --------------------
It is generally scheduled to execute the query, which is not real-time at all.
------ Solution --------------------
How can I solve the problem after seeing it?
------ Solution --------------------
As long as you carefully design the data structure, it is still possible to use php to dynamically rank 10 thousand.