Preface
I was involved in a redis project last year, but I was involved in other projects due to temporary decisions. The heart has been on redis can be said to do not forget, the most impressive is when the first day to hear redis, said it is the
ArticleDirectory
1. Active replication avoids redis replication defects.
2. Online redis resizing through presharding.
The previous article discussed common data types and storage mechanisms of redis. This article will discuss the
I,Principle
RedisThe master-slave replication function is very powerful.MasterYou can have multipleSlaveAndSlaveYou can have multipleSlaveIn this way, a powerful multi-level server cluster architecture is formed. The following is aboutRedisSome
First, configure the environment. Here we will not talk about the redis server and the redis PHP extension package;
View code
Require 'Redis. php '; Require 'Redis _ pool. php '; Require 'Redis _ peer. php '; Class Note Extends Redis_peer {} $
Redis on Windows is a prototype version of redis in windows. It is based on redis 2.4.11 and supports 64-bit windows.
Compilation Method:
Use Visual Studio 10 to open the msvs \ redisserver. sln file and build it.
After the build is
Redis is a high-performance Key-value database. Because its read/write operations are performed in the memory, it can use up to 0.11 million set times per second and get more than 80 thousand times per second.
The installation process is listed
Redis is a high-performance Key-value database. The emergence of redis largely compensates for the shortage of keyValue storage such as memcached, and can play a very good complementary role in relational databases. It provides python, Ruby,
I. Install the redis server first
Redis is a high-performance Key-value database. The emergence of redis largely compensates for the shortage of keyValue storage such as memcached, and can play a very good complementary role in relational
Redis common command set
Commands related to connection operations
Quit: disconnect)
Auth: Simple Password Authentication
Persistence
Save: synchronize and save data to the disk.
Bgsave: asynchronously saves data to the
Redis's support for transactions is still relatively simple. Redis can only ensure that the commands in the transaction initiated by one client can be executed continuously without inserting commands from other clients. Redis processes all client
Redis is short and concise, and the Swiss army knife in the system. I have studied its source code and gained a lot.
1: network framework
2: exquisite implementation of various data structures
3: Persistence
4: Copy
Network Framework
The redis
Common redis Data Types
Redis has the following data types:
String
Hash
List
Set
Sorted set
Before describing these data types, let's take a look at how redis's internal memory management describes these different data types:
First, redis
1. Simplified commands
Analysis: commands in redis Communication Protocol use the original set, get, hset, hget, and other strings, it can be replaced by a single byte, such as 0x01, 0x02, 0x03, and 0x04.
Benefits: reduces network transmission
Redis is an ongoing open-source key-value database project, and the author is antirez. Compared with general key-value databases, redis has the support for linked lists, sets, sortsets, and other composite structures for values in key-value pairs.
(1) test environment
CPU
Dualcore e5800 X2 3.2g
Memory
4G
OS
SuSE Linux Enterprise Server 11 (x86_64)
Client
Jedis
(2) Insert a single value
Insert:
Key = (1000000-10000051) vaue = (1000000-10000051)
Client thread
Insert volume
1
Data Type
As a key-value database, redis also provides ing between keys and values. However, in addition to common values or strings, The redis key value can also be one of the following forms:
L lists (list)
L Sets)
L sorted Sets)
L hashes (hash
1. twemproxy release E
When we have a large number of redis or memcached instances, we can only use some data distribution algorithms (such as consistent hashing) on the client side to implement Cluster Storage features. Although redisRedis cluster
Simple Python Queue with Redis
Posted on June 3, 2012# Python # redis # nosql
The following article shows how to useRedis to build a simplemulti-producer, multi-consumer Queue with an interface similar to thepythonstandardlib queue. With this queue
Extract some of the resources (http://blog.nosqlfan.com/html/3537.html) on nosqlfans, used for a year, will only install, start and get set, really sorry to say will redis
REmote DIctionary Server (Redis) is a key-value storage system written by
Redis is a high-performance key-value database. The emergence of redis largely compensates for the shortage of keyvalue storage such as memcached, and can play a good complementary role in relational databases in some cases. It provides Python, Ruby,
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