SDS (Simple dynamic string) is the Redis-bottom string representation, which has the function of string-object and substitution char*. Value types in a database include strings, hash tables, lists, collections, and ordered collections, but key types
Original code
Object ss = Redis.opsforhash (). Get (Ssbfcs, Llhb_kspsll_ + ID);
Get all the corresponding file names
if (NULL = ss) {
Judge if it's empty.
Redis.opsforhash (). Put (Ssbfcs, Llhb_kspsll_ + ID, "1");
If it's empty, add a new
Brief introduction of Redis persistence:
Redis is a persistent memory database, which means that Redis often synchronizes data in memory to disk to ensure persistence. Redis supports two kinds of persistence, one is snapshotting (snapshot) is also
Attach the code directly
/** * @param subkey Set Key name * @param timeout get lock timeout,if not get, * @param the unit time unit * @para
M svalue * @return/public static Boolean Trylock (String subkey, String Svalue,long Timeout, Timeunit
The previous article mainly introduces the SSM integration and testing.
This article mainly introduces the login module, the login module used to filter, the configuration of the filter needs to be configured inside the Web.xml, the relevant
The project uses the Redis to do the cache server, recently appeared this exception:
Redis.clients.jedis.exceptions.JedisDataException:MISCONF Redis is configured to save RDB snapshots, but was currently not Able to persist on disk. Commands that
1.Redis vs. MySQL transaction
(1) The difference between rollback and discard: If 2 statements have been successfully executed, 3rd error rollback, the impact of the first 2 statements has disappeared discard the impact of the first 2 statements
To connect the Redis cache steps via the Jedis client:
1. Add Jar Package:
POM Coordinates:
redis.clients
jedis
2.7.0
The jar package is as follows: Commons-pool2-2.3.jar Jedis-2.7.0.jar2. Single Instance connection
To connect the Redis service
Redis-cluster
#关闭RDB防止fork进程的内存溢出问题
Save ""
Appendonly=yes
#防止某个节点挂掉, the whole cluster hangs off the question
Cluster-require-full-coverage No
#设置最大内存
MaxMemory
11453246122
11453246122
28991029248
27*1024*1024*1024
#日志
LogFile "./redis.log"
Here is a redis example
Create a new Redisappsecretmanager class to implement the Appsecretmanager interface
/** * How to use: * * @Autowired private Appsecretmanager Appsecretmanager;
@Override protected void Initapiconfig (Apiconfig
second, disaster recovery simulation
Since persistent data is used for data recovery after a reboot, it is very necessary to perform such a disaster recovery simulation. It is said that if the data is to be persisted and stability is to be ensured,
First, preface
The select in the database is the most frequently used, and the basic is the same every time, and the update, delete, insert use frequency does not have a select high, and each time basically is different. In order to reduce the
Micro-blogging function Analysis
Uniqueset class
API
function
Implementation Principle
Uniqueset (client, key)
Sets the client and key for a unique collection.
Is_include (Element)
Redis-dump Command installation environment refer to the link address:http://blog.51cto.com/wujianwei/2105124Redis Database backup script:[Email protected] ~]# cat/data/scripts/dump_redisdata.sh#!/bin/bashsource
1. Connect to Redis:I marked the red place is the Redis IP address, we change to their own good, this keyword requires a string type, a password to specify the password, port and the development machine on the Redis port to be consistent, or will be
Unordered Collection SaddThe set set is directly de-Xiao and only outputs the heheSadd names3 Xiao Xiao hehe heheGets all the values of the collection Names3, and the collection cannot get the value as a slice because it is unorderedSmembers
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