redis are non-relational database, can store a large amount of unstructured data, the operation mode is NoSQL, data storage structure of key-value, the data can be CRUD.
redis Features:
- Based on the operating speed of the C language development program back to soon be able to support 300,000 times per second / collection operation
- Redis is based on memory. The memory and can support data persistence to disk
- Redis data is in the form of key-value, and supports multiple data types String the Set List Object
advantage:
Additions and deletions to change search data, bypassing the process disk io
Disadvantages:
Overall capacity is small (database 20 million, redis memory can store 2 million)
Off easily lost, in a highly concurrent likely to cause a cache memory of penetration \ breakdown \ avalanche
redis build:
Do not install redis JDK when used, can be used directly, redis startup configuration file is based, according to the configuration file instance starts the redis plurality.
1. Download:
2. redis installation
First upload the installation file:
Then extract:
Command: tar -xvf redis-3.2.8.tar.gz
After decompression need to compile redis, you need to go to the next extract directory, execute make the compiler;
Finally, we need to redisde services registered with the Linux system
Command: make install
3. Start redis
Xshell or using other tools, linux system input connected to a start command;
Command: (Note that the command is no space between)
redis-server
This command starts, we need to re-open a command window and then use redis, need to use redis-cli command to start the client before
redis-serve @ background boot (not always stay in the startup screen, no other windows)
The figure shows, starting port number and start the process
4. Close redis
Redis-server in order to start it, you can close the session
Redis-serve @ command to start the process to kill
5. Other:
Persistent file commands: redis-check-rdb / aof persistent file