on the difference and summary of memcache and Redis
Redis and memcached Overall comparison
1 Performance comparison: Because Redis only use a single core, and memcached can use multi-core, so on average each kernel Redis in storing small data than
1. Install gcc
Redis is deployed on a Linux system in a real production environment, so start with a Linux
Redis installation requires GCC, first ensure that GCC is installed on Linux
Enter GCC, prompting for no command, stating that GCC is not
JedisclusterJediscluster is a Java client for Rediscluster that encapsulates various operations for Java access to Redis clusters, including initialization connections, request redirection, and so on. The concrete internal realization principle has
Step reference:
Click on the Open link http://jingyan.baidu.com/article/9113f81b0333e12b3214c7a8.html
Redis for Windows download address:
Click on the Open link https://github.com/MSOpenTech/redis/releases
Phpredis Download Address:
Version:
Redis's excellent performance is because it stores all the data in memory, the same memcached do, but why Redis can stand out, largely because Redis has excellent persistence mechanism to ensure that the server restart, the data will not be lost.
Recently in the maintenance of a cache with the Redis project, encountered a product needs to eliminate the need to clean up the user's data, because each time to clear a lot of user data, each manual deletion is more cumbersome, and finally adopted
1. Redis Lock ClassificationRedis can be used in the lock command table is INCR, SETNX, SET
2. The first type of lock command incr
The idea is that the key does not exist, then the value of the key will be initialized to 0, and then perform the
Redis the operation of the String,list,hash,set,zset data type by the tool class. Add Dependencies
org.springframework.boot
Spring-boot-starter-data-redis
Redis Configuration
Import org.springframework.beans.factory.annotation.Autowired;
Http://www.cnblogs.com/stephen-liu74/archive/2012/02/23/2364717.html
first, the replication of Redis:The first thing to note here is that it's so easy to configure the Master-slave mode in Redis. Believe that after reading this blog you can also
1, interface
/*** Priority to query member information from the cache* @param custnum* @return*/Public member Findmemberbycustnumfristbyredis (String custnum);
2. Implementation class
@OverridePublic member Findmemberbycustnumfristbyredis (String
implementation of distributed lock based on Redis
backgroundAccording to Redis's SETNX command, only one client can get the lock; the Redissonlock distributed lock implementation uses the LUA script, which provides a method that does not apply to
Redis Installation
1, download, decompression and installation:
$ wget http://download.redis.io/releases/redis-2.8.5.tar.gz
$ tar xzf redis-2.8.5.tar.gz
$ cd redis-2.8.5
$ make
The compiled executables are in the SRC directory, respectively, Redis-
wget http://download.redis.io/releases/redis-2.8.6.tar.gz
Tar xzf redis-2.8.6.tar.gz
CD redis-2.8.6
Make
Yes, make makes an error.
GCC class errors are required to install GCC
Such as:
Yum install-y gcc g++ gcc-c++ make
This type of
Open Redis ClientAuthentication information is not configured at the beginning
:6379> config get requirepass
1) "Requirepass"
2) ""
For example, set authentication to 1234
:6379> config set requirepass 1234
OK
If return OK positive modification
Article reproduced from: http://hot66hot.iteye.com/blog/2050676
Reprint Please indicate the source: http://hot66hot.iteye.com/admin/blogs/2050676
Recently studied Redis-cluster, just built an environment, encountered a lot of pits, the system's
installing Redis under Linux systemsFirst step: Download Way 1:http://www.redis.cn/Download from official website Click to download the following screen appears.--------------------------------------------------------------------------------
The use of Redis is very extensive, its advantages are fast, support rich data types, support things operation, such as session cache, full page cache (FPC), queue, etc., greatly reduce the burden of the database.1. Install and download RedisWebsite:
Operation:Step 1:d:\wamp\bin\apache\apache2.4.9\bin/php.ini Add; Php_redisextension=php_igbinary.dllextension=php_redis.dllStep 2: Copy the downloaded Php_redis.dll and php_redis.pdb to D:\wamp\bin\php\php5.5.12\extStep 3: Install the window
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