Installing the Redis on a Linux machine is very easy, not to be introduced here. Since I have only one machine to learn from the master-slave copy function, I need to start multiple Redis instances on a single machine. We need to copy the default
Redis download Address, agreed version number The last even-numbered stable version, the odd is an unstable version, I download here is the redis-4.0.8 version of the/usr/local under the new Redis directory, will download the Redis compression
Description
After the Redis stand-alone deployment is complete, developers need to perform some business operations on the Java Client Connection Redis, the following are some of the basic Java Operational code:
Package com;Import Java.util.HashMap;
Redis's aof persistence strategy is to record every command sent to the Redis server and save it to a aof file on your hard disk, like a log file, and a command to record one.
aof Settings
The location of the AoF file is the same as the location of
Recently read Huangjianhong's "Redis Design and implementation", read the first part, it is the introduction of the bottom-up approach. Starting from the lowest data structure, the data structure used is introduced, and then the database is formed.
Brief introduction
MongoDB is more like MySQL, Support for field indexing, cursor operations, the advantage is that the query function is more powerful, good at querying JSON data, can store large amounts of data, but does not support transactions.
use of five types of data Redis
Redis Five types of data (excerpted from: http://tech.it168.com/a2011/0818/1234/000001234478_all.shtml)
1, String
Common commands:
Set,get,decr,incr,mget and so on.
Application Scenario:
String is the most commonly
installing Redis services with a regular account
Start Installation
This is done using the 2.8 version of Redis for installation, with security in mind, installation using a regular account, and Redis general account setup scripts I've made into
To make a platform, the design requires the ability to read and write 10,000 times per second in a database of 80.01 billion records.
I chose a redis cluster. My approach is implemented in conjunction with the documentation provided by the Great God
1, the introduction of RedisRedis Open Source memory database, storing data in key-value way; Redis features: 1), Redis data is completely stored in memory, using disk only to persist data, solve the problem of data loss caused by restarting the
Like the reason for MySQL master-slave replication, Redis reads and writes are particularly fast, but it can also produce a particularly high read pressure situation. In order to share the read pressure, Redis supports master-slave replication, and
1. Installation Dependencies
Yum install-y wget gcc make tcl
2. Download the source code and install it into the Redis website
https://redis.io/download/
Download the latest versionwget http://download.redis.io/releases/redis-4.0.6.tar.gzTar xzf
keys keyword common directives
Here bloggers first set K1 v1 k2 v2Exists key
Determine if key exists
Move Key Dbnum
Move key values to Dbnum libraryHere move K1 to library 2nd, view current library only K2, after switching to library 2nd, view the
Hset key field value
Function: Set the value of the filed field in the key to value
Note: If there is no field field, add directly, if any, overwrite the value of the original Field field
Hmset key field1 value1 [field2 value2 field3 value3 ...
Brief introduction
MongoDB is more like MySQL, support field index, cursor operation, the advantage is that the query is more powerful, good at querying JSON data, can store large amounts of data, but does not support transactions.
MySQL is
Redis is now a popular cache database, and it is generally found that it can store strings (string), hash tables (hashes), lists, collections (set), ordered collections (sorted set), and so on. Redis is a Key-value store, and value can contain many
The full code is too long, here's a thought.
1: Before the start of the kill activity, the SKU and inventory of the item are credited to Redis
Redistemplate.expire (sku,25,timeunit.hours of goods); Cache 24 hours with the unique identity of the
Base 2.8.7
Redis is a large dictionary that contains a lot of key-value pairs, and this dictionary supports a very rich set of value that can be used for strings, hash tables, lists, collections, and ordered sets, based on these types of rich value,
Redis is a large dictionary that contains a lot of key-value pairs, and this dictionary supports a very rich set of value that can be used for strings, hash tables, lists, collections, and ordered sets, based on these types of rich value, extending
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