Redis is a high-performance key-value database. The emergence of Redis, to a large extent, compensates for the shortage of such key-value storage in memcached, and in some cases can complement the relational database well. It provides a
First, Redis characteristicsFeatures: Fast, key-value based data structure server, rich, simple and stable, client language multiple, persistent, master-slave replication, support high-availability and distributed single-threaded Architecture: Redis
What persistence mechanisms are provided by Redis:
1). RDB Persistence:
This mechanism is to write a snapshot of an in-memory dataset to disk at a specified time interval.
2). AoF Persistence:
This mechanism will log every write that the server
In this paper, Redis How to save relational data, and how to match, scope, fuzzy query For example, fuzzy query function is based on the latest 2.8.9 version. 1 Storage of relational data
Take the staff object as an example, in a relational database
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
Although Redis has excellent performance, we can still master/slave this simple architecture, read and write separation, further mining redis performance, improve system availability.
Redis How to do master and slave copy. Redis replication is
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
First think of a question,
why Redis faster than memcached.
General idea: Memcached is completely based on memory, and Redis has persistent preservation characteristics, even if asynchronous, Redis can not be faster than memcached.
The actual test
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), Zset (sorted set– ordered set), and hash (hash type). These data types
Persistence Options
directory where persistent files are stored:
Dir./
snapshot Persistence (snapshotting)
Store all data to diskCommon configurations:
Save
stop-writes-on-bgsave-error No
rdbcompression Yes
dbfilename Dump.rdb
There are several
Opinion one:1. Redis and memcache all store data in memory, which is the memory database. But memcache can also be used to cache other things, such as films, videos and so on;2, Redis not only supports simple k/v type data, but also provides storage
1, stringIt can be a string, an integer or a floating-point number, perform an operation on the entire string or part of a string, perform a self-increment (increment) or decrement (decrement) operation on the whole integer or floating point.String
Before the mid-autumn project engage in activities, users are more active SE. Redis frequently reported Timeout exception, Crazy turned over a wave of issues found that the problem is quite a lot of, the author very frequently referred to the use of
Redis Face Test Summary (1)February 28, 2018 17:42:21 lsx 丨 Mr. Pen read: 3568 more Personal Classification: A summary of the questions(1) What is Redis?Redis is a high-performance, memory-based Key-value database. (Free to add, with an
Memcache is the easiest way to compare it with redis. However, besides redis does not support clusters, I think using redis may have better results.
Redis Official Website: http://redis.io/
References:
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