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.
one: About Redis cluster
the present situation of 1:redis cluster
Reids-cluster plans to launch in redis3.0, can be regarded as a Antirez statement: HTTP://ANTIREZ.COM/NEWS/49 (PS: Skip the ticket for a long time, this year seems to speed up), the
Redis is a key-value storage system. Like memcached, it supports a relatively larger number of stored value types, including string (string), list (linked list), set (set), and Zset (ordered set). These data types support Push/pop, Add/remove and
dear friends, long time no see. Has not been updated recently, because the company's project has been catching progress, but also table structure replacement, and refactoring, but also iterative requirements. Feel the project is going to be rotten ..
1, window under the Redis installation
Address: https://github.com/MSOpenTech/redis/releases
Download redis-x64-3.2.100.msi or redis-x64-3.2.100.zip are available
2, click on the file to install, after installation to find Redis installation
Redis is a commonly used database of non relational types.So we also need to know some of his common operating instructions.
Redis data types are mainly divided into strings, hashes, lists, sets, and so on.
String set--set name 1234//Set key
Principle:
Gets the specified name key if present, if there is no key, if there is no value assigned to the key, then set the expiration time;
The logic to unlock deletes the key.
1. Custom class
Package com.xxx.cloud.assets.redis.lock;
Import
set Type
Set is a collection, which is an unordered collection of string types.
Set is implemented through a hash table, and the complexity of adding, deleting, and finding is 0 (1).
We can take the set, the intersection, the difference set.
Sadd
Redis capacity and usage planningIn the use of Redis process, we found that a lot of redis different from the memcached, but also different from the characteristics of MySQL.
(This article mainly discusses Redis is not enabled for VM support) 1.
The first figure, the use of the Redistemplate interface to call the data to find the result is empty, this is strange, the data written in the visual software to find out is this:
Classpathxmlapplicationcontext classpathxmlapplicationcontext = new
Redis is a key-value storage system. Like memcached, it supports a relatively greater number of stored value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered set), and hash (hash type). These data types
Ps-ef |grep Redis Check if the background process is running
#检测6379端口是否在监听
NETSTAT-LNTP | grep 6379
#使用 ' redis-cli ' client detects a connection is normal
./redis-cli
Stop it
#使用客户端
REDIS-CLI shutdown
#因为Redis可以妥善处理SIGTERM信号, so
One: Make compile, there is an error
Solution: Take a closer look at the error location information, it is possible that some things are not installed, put these things installed will be no problem
Two:
Warning:no config file specified, using
What is NoSQL?
NoSQL is the database solution to solve a series of problems, such as high concurrency, high availability, high scalability, and big data storage.
NOSQL, called a non-relational database, whose full name is not the only SQL. It can
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
* Features * Key-value
Java map:string value = Map.get ("key") Python dict:dictionary["key"] value ...
BitMaps Bitmap bron Filter Hyperloglog Ultra Small Memory unique value Count GEO Geographic information positioning speed fast
10w OPS is the
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
1.strings (String)
A) If you use only the string type in Redis and do not use the persistence feature of Redis, then Redis is very much like memcache;
b) When a numeric operation is encountered, it is automatically converted to a string, such as
Redis is a NoSQL database. This series of blogs is mainly for the installation of the server environment problems encountered. Using NoSQL databases can improve the efficiency of data access. Because I used redis in my project, and now I need to
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