first, the MyBatis cache
Like most ORM layer frameworks, MyBatis naturally provides support for first-level caching and level two caching. This is the role and definition of the first-level cache and the level two cache.
1, the first cache is the
With the further development of web2.0, the productivity of netizens is further improved and the total amount of storage begins to increase. While it is still a mode of reading and writing less, the amount of writing has been greatly improved. The
Redis 3 All commands
Note: This article refer to Redis Chinese web, content update. The list of commands in the redis.cn redis Chinese network is Redis version 2.8, this article is the latest Redis 3.0 version of all the commands (in fact, more
Affairs
Ømulti,exec action: Start and end tag of transaction
N executes the multi command, Redis feedback OK indicates the start of the transaction, executes the EXEC command, ends the transaction, and begins the sequential execution of the
Transferred from timyang:http://timyang.net/data/redis-misunderstanding/
A few days ago Weibo had a large system failure, many technical friends are more concerned about, the reasons for this will not exceed James Hamilton in the designing and
Redis Implement distributed lock
In the cluster and other multiple servers often used to synchronize the business, then the ordinary transaction is to meet the needs of the business, the need for distributed locks. Distributed locks are implemented
The first step is to modify the configuration file
############################# EVENT NOTIFICATION ############################### Redis can notify Pub/sub clients about events happening in the key space.# This feature was documented at
Execute Redis command with LUA script in C #To directly post the code to implement the Lua script method, the Third-party class library used is Stackexchange.redis (nuget) Note: The following code is simplified, the actual use to modify,
Using
Through a brief introduction of the previous article "Redis simple Use", this article mainly elaborates the five types of operation of Jedis to Redis: string, list, hash, set, ordered set. Jedisutil
The test cases here are run using JUNIT4,
The pub/sub mechanism of Redis is very similar to the observer design pattern in 23 design patterns. But Redis is more portable and simple to implement for this mechanism, without the complicated logic consideration of the observer pattern and only
Using clusters
The main record is the operation of learning Jedis. third, add new nodes to the cluster
Depending on the newly added node type, there are 2 ways to add new nodes to the cluster.
1: If you add a new node that is a master, then we
Expiration time of keys
Typically, the Redis keys are created without setting the associated expiration time. They will always exist unless you use the displayed command to remove them, for example, by using the Del command.
Expire a class of
Redis Installation Process
Download installation package, unzip, Mac system put folder under/usr/local folder
Open the terminal and install server-side servers firstTerminal $ cd/usr/local/redis/
Go to the file and enter the Redis.config fileFind
Redis is a distributed NoSQL database system oriented to "Key-value" type data, which has the advantages of high performance, persistent storage, and adapting to the highly concurrent application scenarios. Although it started late, but the
# Redis configuration file
# When you need to configure the memory size in the configuration, you can use similar formats such as 1k, 5GB, 4M, which are converted as follows (case-insensitive)
#
# 1k =>
1000 bytes
# 1kb => 1024 bytes
# 1m => 100000
Picture because the file is relatively large, commonly used pictures such as reading the database or file to increase the system load. The use of caching methods can increase
Nginx+tomcat+redis Configure session sharing and load balancing
Using Nginx as a front-end server, the required session is deposited into the Redis, and the session can be taken from the Redis when one of Tomcat hangs.
There are two options
The following information can be obtained from the console input Info command return ( or Redis clients to find information separately )
redis_version:3.2.3Server
1. Put the downloaded compressed package into the/usr/local directory# tar Xzf redis-3.0.2.tar.gz
# cd redis-3.0.2
# Make
Prompt error Make:cc:Command not found make: * * * [ADLIST.O] Error 127GCC is not installed, you need to install GCC
# yum
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