Before we introduced a brief introduction to Redis, knowing some of its features and its role, let's look at some of the simple commands it uses in practice, and some of its advanced features.
One, Common command 1, String type(1)Set Key
Part I: Installing RedisWant to install Redis to this directory
1
/usr/local/redis
You want to download the installation package to this directory
1
/usr/local/src
Then the installation
In fact, this is quoted from netizens http://blog.csdn.net/tuposky/article/details/45340183, there are 2 versions, the difference is reentrantlock and synchronized. In addition, the original person used the assertion, I think this is still not
1. Introduction to RedisRedis is a key-value storage system. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered collection), and HASHS (hash type). These
NoSQL Introduction
NoSQL (not just SQL), meaning anti-SQL movement, is a new revolutionary movement of the database. It refers to the Philippine relational database. With the rise of internet web2.0 website, the traditional relational database
Have a nice smileThe tortoise was wounded. Let the snail buy medicine. It's been 2 hours. The snail hasn't come back yet. Turtle nasty scold: no fucking come back I'm dead! Then came the voice of the Snail outside the door: You say the mother said I
# Redis configuration File Sample # Note on units:when memory size is needed, it's possible to specifiy# it in the usual form of 1k 5GB 4M an D so forth:## 1k + bytes# 1kb = 1024x768 bytes# 1m = 1000000 bytes# 1mb = 1024*1024 bytes# 1g = 10000 00000
ConnectionMultiplexer 可以注册如下事件
ConfigurationChanged-When configuration changes
ConfigurationChangedBroadcast-When you update a configuration by publishing a subscription
ConnectionFailed-The connection fails and you will not receive this
Learn Redis in need to organize and configure more things, resources are more scattered! This time the main is to integrate knowledge, the development process needed to integrate the resources, but also to facilitate the future involved in this area
Redis Common configuration:1, the use of master and slave mutual master from the way, two important commands:Redis 127.0.0.1:6379> slaveof NO OneRedis 127.0.0.1:6379> slaveof 10.10.51.236 63792, modified to the background process mode: daemonize Yes3
Command
Instances and commands
Persist
Persist Key-name the expiration time of the removal key
Ttl
TTL key-name How many seconds before the key expires
Expire
Expire key-name
Using RedisSet type: No duplicate elementsList linked list type has repeat-tired typeSort set type has no repeating elements1.1 Store Data Read dataData is stored in memorySet name Laowen//OK indicates successSet age//OK indicates successSet add
Set Collection typeInterpretation:Redis's set is an unordered collection of type stringThe set element can contain a maximum of (2 of 32 square-1) elementsFor the Set collection type in addition to the basic add delete operation other useful
In today's concurrent environment, it is best to cache queries for large volumes of data using Redis to build clusters(Personal like Redis, memcache not cold)Redis is a cluster feature added after 3.0, very powerfulThere should be at least three
Simple string type data write. Poco is serialized as a JSON string in Redis.1 using(varRedis =Newredisclient (connstring))2 {3 if(Redis. Db! =7)4((redisclient) redis). Changedb (7);5 6 varClient = Redis. As();7
First, Redis's replication:The first thing to note here is that it's too easy to configure the Master-slave mode in Redis. I believe you can do it easily after reading this blog. Here we should first list some theoretical knowledge, and then give
Storing string strings, using the Get,set command, a key for maximum storage of 512MStore hash hash, use Hmset and Hgetall command, parameter: key, valueExample: Hmset user:1 username Taoshihan password TaoshihanHgetall user:1Stores the list of
Centos6.7 Source Installation RedisDemo EnvironmentSystem: Linux CentOS 6.7 64-bitAccount Number: RootEnvironment: No Redis installedOfficial website Download redis3.0.7 This is the latest version of the currenthttp://www.redis.cn/650) this.width=650
The following is a question from a question on Quora, which is five questions to avoid with Redis. The answer, which goes beyond the five-question category, describes five considerations for using Redis. If you are using or considering using Redis,
Redis Learning Notes (add and subtract) adds a key to the databaseSET key value Get the key in the databaseKEYS pattern Pattern supports GLOB style wildcard format"?" matches one character"*" matches any character"[]" matches any one of the
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