Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of redis knowledge

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Redis7 data structure: string, hash, collection, list, ordered collection, geographical location GEO,hyperloglog string the simplest and memcache-like key-value storage internal data structure is SDS (simple dynamic characters), can do distributed lock, setnx. Hash can store individual properties of an object, with hash and ziplist encoded internally. Using ziplist will save more memory. But encoding is limited by the size of the string and the number of key. Sets can be de-duplicated, statistical size, intersection union, difference sets, such as friend follow list, like and so on. List list can do message queuing, recommendation list, paging, etc. GEO can get the location and use it as a map recommendation. Bitmap setbit can count independent ip visits. Hyperloglog can also count the number of visitors, which only takes up 12kb to count billions of visits, but the statistics are not accurate. The Bloom filter constructed by bitmap and hash function can filter spam and filter, such as 5 billion phone number to quickly and accurately determine whether 100000 phone numbers exist. Redis sentinal,redis cluster is the redis high availability architecture, the former is simple and the latter is complex. Redis big key hotkey solution: split key to multiple instances, split value, add machines, add memory, add monitoring, make rational use of data structures, and preheat data. Redis is single-threaded, and a time-consuming command will block the service. Be careful to use some slow queries to jam the service. Such as keys hgetall del, etc.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report