Let's talk about something today, NoSQL. A listen to NoSQL maybe many people will feel very tall feeling, but actually contacted also feel OK, with the current data of the crazy explosive growth, traditional RDBMS also more and more exposed his
Structure Type
values stored by the structure
the ability to read and write structures
String
can make strings, integers, floating-point numbers
Performs an operation on an entire string or part of a string, and
First, download the latest version of the Redis cd/usr/local/src wget-c https://redis.googlecode.com/files/redis-2.6.14.tar.gz
Second, compile and install Redis TAR-ZXVF redis-2.6.14.tar.gz cd redis-2.6.14 make sudo do install you need to install
Redis is a NoSQL database based on key-value pairs (key-value), which contains a variety of data structures. The number given on official web is read and write performance can reach 100,000/sec, visible speed.
As a simple example, open 5 Redis
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
#!/bin/sh
# chkconfig:2345 90 10
# Description:redis is a persistent key-value database
# simple Redis INIT.D script conceived to work on Linux systems
# as it does use of the/proc filesystem.
Spring Bean
-- --
Use
@Resource (name = "Mutiljedispoolmap") public map Mutiljedispoolmap; /** * Method Description: Get Jedis object from Connection pool */public Jedis getresource (String redispoolkey)
problem Description: My Redis is installed on the CENTOS7 operating system of the virtual machine, but running my Windows write Jedis program has always reported the connection timeout, I try to add connection time in Jedis, but has been no effect,
Redis backup and restore, with the help of third-party tools, Redis-dump
1, install Redis-dump
[Root@localhost tank]# yum install ruby RubyGems ruby-devel //install RubyGems and related packages
[root@localhost tank]# Gem Sources-a
problems encountered
Springboot Integrated Redis, refer to the blog:
Http://www.tuicool.com/articles/mAriMbI
Problems that exist:When injecting redistemplate, if you follow the blog's approach, add generics
@Autowired
Private redistemplate
Redis a master multi-slave spring configuration
public class redistest{private ApplicationContext context;
Private Redistemplate redistemplate;
Final String key = "Key7";
@Before
①: Enter the redis-3.0.7 (folder to store the source code)
②: Copy redis.conf to Bin directory
③: The view card matches the permissions of the past redis.conf, as shown below:
➣:-rw-r--r--: The owner has permission to read and write, and the
Redis is started in the cmd window, and the operation will be error when the window is closed.
Installing Redis as a service enables it to start in the background without worrying about shutting down the service window.
The configuration is as
1. Download the installation package, unzip, build the soft chain
wget http://download.redis.io/releases/redis-4.0.8.tar.gz
tar zxvf redis-4.0.8.tar.gz-c/opt
cd/opt
Ln -SV Redis-4.0.8/redis
Redis and redis-4.0.8 Two folders will be available in
Redis provides two persistence options, the RDB and the AOF, respectively.
By default 60 seconds are flushed to disk once [save 60 10000 when there are 1w keys data is changed when the],redis data set is saved in a binary file called Dump.rdb, this
Task Queue
Using the Lpush and Rpop command action lists to implement the queue
Blpop key [key ...] timeout (s)
Brpop key [key ...] timeout (s)
Blpop/brpop is a blocking type that detects multiple keys at the same time and blocks if none of the keys
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
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.