In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Redis (remote dictionary server)
Redis features:
1) supports memory caching, which is equivalent to memcached
2) persistence, which is equivalent to memcachedb,ttserver
3) richer data types
4) support clustering and distributed
5) key-value key type storage system
6) support reliable data storage and landing
7) single-process, single-threaded, high-performance server; (multiple instances can be implemented)
An instance has 20-30GB memory.
8) crash safe & recovery slow
9) stand-alone qps can reach 10w
10) suitable for high-speed read-write access with a small amount of data
11) support master-slave replication on different machines
12) support publish/subscribe (publish / subscribe), notification, key expiration, etc.
Redis supports relatively more value types for storage, including string (string), list (list), set (set), and zset (ordered set) and hash, etc. Like memcachedb, data is cached in memory to ensure efficiency, except that redis periodically writes updated data to disk or modification operations to appended record files, and realizes master-slave (master-slave) synchronization on this basis
These data types support push/pop, add/remove and rendezvous, union and difference sets, and richer operations, and these operations are atomic and lock-free.
Disadvantages:
1) change the code from reading memcached to reading redis
2) the delay of different commands varies greatly.
3) large memory management overhead (lower than 3x5 of physical memory)
4) buffer io causes system oom (memory overflow)
Redis persistence
1) snapshot (snapshot) writes the data in memory to disk at one time, which requires an update of key (enter trigger type)
2) aof (binlog log), which records the log of each update without causing data loss; (not used for master-slave synchronization) is only used to save data
The best application scenario of redis
All data of 1.redis are in memory.
two。 The best substitute for memcached
3. Business where data is important and has certain requirements for data consistency
4. Redis is more appropriate when more data type support than key/value is needed
5. Need to provide master-slave synchronization and load balancing distributed application scenarios (redis master-slave synchronization)
Production experience and lessons of redis
1. To configure master-slave master-slave synchronization, you can switch over in the event of a service failure
two。 Disable data persistence on master, just configure data persistence on slave
3. Physical memory + virtual memory is insufficient. At this time, dump has been dead, and the machine has hung up after a long time.
4. When redis physical memory use more than 3 / 5 of the total memory capacity will begin to be more dangerous, start to do swap, memory fragmentation is large!
5. When the maximum memory is reached, the key with expiration time is emptied, even if the key has not reached the expiration time
The problem of synchronous writing between 6.redis and db: write db first, then redis, because there is basically no problem with writing memory.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.