PHP ranking function, thoughts

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.