1. Basic Concepts
Redis is an open-source high-performance key-value storage database developed by Salvatore Sanfilippo (Italy), which released its first version in 2009 and with the same year open source, official site: http://www.redis.io/, The latest stable version is 2.8.17. It is recommended that online business use a stable version earlier than the current 1-2 version ~ Redis itself offers a variety of key-value data types to suit the storage needs of different scenarios, while using his data types combined with various packages of interfaces can be implemented such as caching, queuing and other functions of the application. At the moment, the online business I'm in touch with is using its caching capabilities.
2. Rich Features
1. Data type: String type, hash type, list type, collection type, ordered collection type
2. Memory storage and persistence: Data memory storage, strategy landing drive
3. Feature rich: Cache (Configure time-to-live use), Queue (list type, support blocking read)
4. Support multi-DB: Support 16 databases, NO. 0 database is used by default, you can switch with the Select command.
Note: Multiple databases are not completely isolated, using Flushall will clear all DB data in the. The database does not support renaming and does not support separate permission controls.
3. Jane single Ann installed
# tar XF redis-2.8.17.tar.gz #发现目录中有Makefile ASCII file, can be compiled directly # make# make test# make install #实际上执行复制命令到/usr/loca L/bin operation (command can be used directly)
4. Common commands
Redis-server redis.conf #Redis启动命令redis-cli #Redis命令行客户端redis-benchmark #Redis性能测试工具redis-C Heck-aof #AOF文件修复工具redis-check-dump #RDB文件检查工具
5. Simple to use
1. Configure initialization scripts: Write the start and stop commands to the script
2. Create a required folder: It is recommended to manage Redis by instance, creating separate profiles, log files and data files for each instance
3. Modify the configuration file according to the requirements: recommend the template, use the initialization script to make corresponding changes
4. Set Boot start: Single instance suggestion with Chkconfig management, multi-instance suggestion to join Rc.local file
6. Example
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/54/15/wKiom1R3SCKSnWedAASIHwCEgVE302.jpg "title=" Redis.png "alt=" Wkiom1r3scksnwedaasihwcegve302.jpg "/>
This article from "Haris" blog, declined reprint!
Introduction to Redis basics and installation examples