What is Redis
Redis (Remote Dictionary Server), the remote dictionary service!
It is an open source log-type, Key-Value database that is written in ANSIC language, supports the network, can be based on memory and can be persisted, and provides APIs in multiple languages.
Redis periodically writes updated data to disk or writes modification operations to additional record files, and on this basis, it realizes master-slave (master-slave) synchronization.
Free and open source! It is one of the most popular NoSQL technologies at the moment! It is also called a structured database!
What can Redis do
1. Memory storage and persistence. The memory is lost when power is off, so persistence is very important (rdb, aof)
2. It is highly efficient and can be used for high-speed caching
3. Publish and subscribe system
4. Map information analysis
5. Timing Finder, counter (views!)
6,...
characteristic
1. Diverse data types
2. Persistence
3. Cluster
4. Transaction
5.…
Windows installation
After downloading, decompress
and double-click to start.
Use the client to connect to Redis.
The ping command is connected successfully.
Since it is stored in the form of key-value pairs, a simple access process can be realized as shown in the figure.
However, in daily development and use, we recommend that it be carried out in the Linux environment.
Linux installation
Command: wget http://download.redis.io/releases/redis-5.0.8.tar.gz
Unzip: tar -zxvf redis-5.0.8.tar. gz
Redis configuration file
Basic environment installation:
yum install gcc-c++
make
Make again
make install
Redis default installation path: /usr/local/bin
Create a folder in the bin directory and copy the configuration file here
Modify the configuration file
In this way, it is started in the background by default.
Start the Redis service
redis-server kconfig/redis.conf
Client connection service
redis-cli -p 6379
This is the same as under Windows.
Check whether the Redis process is started