Redis can be used to do what

redis What can you do? To talk about the blog post, for example, of course, there are many other features redis, doing follow-up presentation.

Redis is the most widely used Internet technology storage middleware, it is "Remote Dictionary Service" acronym, which is "remote dictionary service."

Posts record number of points praise, comments and clicks (hash) - many recorded for the post, key number name, value is the value of various numbers.

Posts record user ID list (sorted) for quick display posts a list of users (zset) - Record id instead of the article is to reduce the memory required, while zset the score can be used to sort.

Messages of title, abstract, author and cover information, a list of page impressions (hash) - many recorded for the post, key is the name of the necessary information, value for the various values.

User ID list records thumbs posts, comments ID list, and for displaying the count to weight (zset) - single field recording, will not be repeated.

Cache recent hot posts content (post content space occupied by relatively large), the pressure to reduce database (hash) - retie a small number, so all content caching, key for the id, value for the content of the post.

Messages related article ID, content recommendation related posts (list) - related articles, the concept of correlation, it is necessary to order, and the list can be used as a queue and stack.

If the message ID is an integer increment can be used to assign Redis post ID (counter). The relationship between collections and posts (zset) - ordered not to repeat.

Hot List posts record ID list, the total hot list and classify Hot List (zset) - ordered not to repeat.

Cache user behavior history, malicious behavior filter (zset, hash) - ordered not to repeat the record for the user-to-many behavior.

Guess you like

Origin www.cnblogs.com/QuickSlow/p/12550160.html