The NoSQL product to be evaluated in this article is Redis. It can be understood as a Key-Value data structure operation. The data is stored in the memory and regularly refreshed to the disk, high read/write efficiency has attracted much attention. Sina Weibo in China uses Redis to store user relationships and count on a large scale.
Jieshao
According to the official statement, Redis is developed using ansi c and runs on Most POSIX (Linux, * BSD, OS X, and Solaris) systems. It does not officially support Windows versions. The latest version is 2.2.11, which fixes a bug caused by traversal optimization in version 2.2.7.
Unlike the common Key-Value structure, Redis's Key supports flexible data structures, including strings, hashes, lists, sets, and sorted sets. These flexible data structures enrich the application scenarios of Redis and meet the flexible storage needs of more businesses.
Redis data is stored in the memory, and the underlying implementation of the epoll event loop is self-written, rather than the use of open-source libevent and other general frameworks, so the Read and Write efficiency is very high. To achieve data persistence, Redis supports regular refresh (which can be implemented through configuration) or log writing to save data to the disk.
Installation and Use
Because there is no third-party package dependency, Redis installation is very simple:
$ Wget http://redis.googlecode.com/files/redis-2.2.11.tar.gz
$ Tar xzf redis-2.2.11.tar.gz
$ Redis-2.2.11 cd
$ Make
After the installation is complete, execute the redis-server under the src directory to start the Redis process. However, you 'd better configure the redis. conf file first. The following are common parameters to note:
Daemonize yes
Specify that Redis runs as a daemon.
Pidfile/home/banping/redis. pid
When Redis runs as a daemon, it writes the pid to the specified file.
Port 6379
Specifies the listening port. The default port is 6379.
Bind 192.168.0.35
The IP address of the bound host.
Logfile stdout
Specifies the log record method. The default value is standard output.
Databases 16
Set the number of databases.
Save
The default configuration file of Redis provides three conditions:
Save 900 1
Save 300 10
Save 60 10000
[Content navigation] |
Page 1st: install and use Redis |
Page 1: Test Description: test environment |
Page 1: Test Results and summary: write operations |
Page 1: Test Results and summary: read Operations |