In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. What is redis?
Redis as an open source key-value store, compared with the traditional Kmurv open source storage scheme, its value type supports a variety of common data types (such as strings, hashes, lists, sets, sorted-sets, etc.). Because of this, it can be used in a variety of application scenarios.
In particular, it is important to note that when the data that needs to be processed can be fully accommodated by memory, Redis can exert its excellent performance, namely Redis works with an in-memory dataset.
Redis supports data persistence (persistence), so that after the Redis service is restarted for various reasons, the existing data can be load to restore the service status. Users can choose two persistence strategies according to their actual usage:
1) RDB method: dump memory database to disk
2) AOF mode: record each write to a command log file so that the log can be played back to restore the data state when the server is restarted (similar to MySQL's binlog)
Redis supports Master-Slave Replication, and the slave library synchronizes the master database data in a full mirror image in case of system failure.
Redis currently does not support clustering, but the version that supports clustering is already in the author's development plan (cluster currently has an alpha version, and the production environment has not yet released a version available).
Although there is no official cluster implementation, the mainstream practice in the industry is to use Partitioning to distribute data sets to different redis instances, thus realizing the support of redis clusters in disguise. Here on the redis official website describes the implementation of partitioning and recommends an open source proxy-twemproxy of twitter that supports redis (the proxy was originally opened as memcached proxy).
There are two basic concepts to distinguish: Redis Master-Slave Replication, which implements full mirroring of data between the two libraries, and Redis Cluster, which hashes user data to different machines, where only part of the user data is hold by the Redis node of each machine.
Personally, the two methods can play the role of single point fault tolerance, but the implementation methods and applications are different.
Redis can also be used as a Message Queue. The supported instruction set can be found here.
For more basic introduction to Redis, you can check out its official website documentation directly.
2. Redis Architecture
There are a lot of materials to refer to about the structure and implementation details of redis. Here are 2 recommended articles:
1) Redis author antirez's explanation of Redis's design philosophy: Redis Manifesto
2) The architecture of REDIS
3. Redis Performance and Application
Redis is known for its high performance (full-memory hold data, typical "space-for-time"). Here are two articles about its performance benchmarks:
1) performance testing tools and test results officially released by Redis
2) TimYang: MemcacheDB/Tokyo Tyrant/Redis performance comparison test
Although redis is very popular in the industry, it is not a panacea. About the common applications and precautions of Redis, here are 2 pieces of information recommended:
1) Common Web Use Cases Solved In Redis
2) several misunderstandings of TimYang: Redis
Issues to be explained:
With regard to performance, even assuming that the configuration of the test machine is the same, different startup configurations of Redis will have an impact on Redis performance metrics (such as the configuration of persistence policies). Therefore, a variety of performance test results have reference significance, but can not be copied mechanically.
As for the application, it is not limited to the information given in this article. If you are interested, you can search with key words such as "redis use case" or "redis application".
4. Redis Installing
The Redis source code has no external dependence, so it is very convenient to compile and install. After downloading the latest stable version of the source code from the official website, you can decompress the make.
The compiled bin files are located in the src directory of the source code and are named after redis-xxx. Where:
There are 5 executable binary files:
A.redis-benchmark # performance testing tool
B.redis-check-aof # aof File repair tool
C.redis-check-dump # rdb File repair tool
D.redis-cli # Command Line interaction tool
E.redis-server # redis server
Two conf files:
Configuration file for a.redis.conf # redis server
B.sentinel.conf # redis sentinel configuration file for monitorin
After the compilation of redis server, before deploying and starting the instance, you need to have a clear understanding and reasonable configuration of the configuration items in redis.conf, otherwise it may affect the performance of redis or cause data loss. Due to space constraints, the configuration description of redis will be described in detail in the next note.
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.