Download Redis and install
$ cd/home/redis
$ wget http://download.redis.io/releases/redis-3.0.2.tar.gz
$ tar xzf Redis-3.0.2.tar.gz
$ cd redis-3.0.2
$ make
$ make install
boot, in the Redis file below the src file
$ cd src
$ ./redis-server
or
The data structures supported in Redis are much more than memcached, such as basic strings, hash tables, lists, collections, sortable sets, as well as the various operations on the data structure, which is an important reason for Redis to be popular.
Predis
The Predis is intended for use in Redis for more than PHP 5.3, including the use of clusters. Key Features support various versions of Redis (from 2.0 to 3.0 and unstable) using hashing or user-defined methods for client shard support for
(i) string SDS
1) Sdsnew: Create a SDS containing the given C string
2) Sdsempty: Create an empty SDS that does not contain any content
3) Sdsfree: Release of the given SDS
4) Sdslen: Number of bytes of used space returned to SDS
5) Sdsavail: The
incr
usage
incr Key, you can increment the key value atom by 1 and return the new value corresponding to the key after the increment operation. If the specified key does not exist, its value is set to 0 before the incr operation is performed.
/*
In a real-world working environment, Redis is installed on the server, and we want to use the Redis terminal for Redis services. Redis-desktop-manager is to connect the Redis service and we can learn to use it.
First, install Redis-desktop-manager,
Reference: https://jingyan.baidu.com/article/2c8c281dbd079f0008252a0f.html
https://blog.csdn.net/qq_36663951/article/details/78340303
The Redis cache is efficient, but it takes up valuable memory resources in our system, especially when our
Preface
An ordered collection type is the highest and most complex type of Redis five data types.
After explaining set, we see the difference between set and sorted set.
Compared with set, sorted sets is to add a weight parameter to the elements in
one, MySQL has 2000w data, Redis only 20w of data, how to ensure that the data in Redis are hot data
related knowledge: when the Redis memory dataset size rises to a certain size, it will implement a data-phase-out strategy. Redis offers 6 kinds of
11 Types of Redis Web application Scenarios2015-04-07 10:46 Anonymous Gray's blog size: T | T
Some Redis primitive commands, such as Lpush, LTrim, and Lrem, can be used to help developers accomplish the tasks they need--tasks that are difficult or
In general, Redis's Zset provides a wealth of functionality that can form many applications.
In Redis, there are many features that are available.
Ordered set (Sorted set) zadd zrem zcard zcount zscore zincrby zrange zrevrange zrangebyscore
Redis Command
Redis commands are used to perform operations on the Redis service.
A Redis client is required to execute commands on the Redis service. The Redis client is in the Redis installation package that we downloaded earlier. Grammar
The
The Redis Save command is used to create a backup of the current database.
Grammar
Example
Redis 127.0.0.1:6379> SAVE
OKThis command will create the Dump.rdb file in the Redis installation directory.
Recovering Data
If you need to recover
Redis Learning Manual (opening)
Http://www.cnblogs.com/stephen-liu74/archive/2012/02/13/2348935.html
First, Introduction
Second, the advantages of Redis
Third, the current version of the main problems of Redis
Iv. Comparison of relational databases
First, Protected-mode
By default, Redis node and Sentinel Protected-mode are yes, and if you want to connect a Redis cluster remotely from a remote connection, you need to modify the Protected-mode of Redis node and Sentinel to No, If you only
Each hash can store 4,294,967,295 key-value pairs
Type of hash (hash):
Hset Assignment Value
127.0.0.1:6379> hset H1 username java1234(integer) 1127.0.0.1:6379> hset H1 Password 123456(integer) 1
Hget value
127.0.0.1:6379> Hget H1 username"Java1
Source: Click to open the link
For cache invalidation, different cache has different processing mechanism, it can be said that there is a small difference in Datong, the author through the Redis documents and related source of the careful reading,
Reprint please indicate the source ha: http://carlosfu.iteye.com/blog/2254154
Because the speech time is limited, about Redis-cluster, the speaker did not do too many introductions, simply introduced some redis-cluster concept function and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service