First, Redis's replication:The following list clearly explains the features and benefits of Redis replication.1). The same master can synchronize multiple slaves.2). Slave can also accept other slaves connection and synchronization requests, which
ObjectiveThe underlying implementation of reflection in Java is that the classloader of the JVM obtains the fully qualified name to create the class.Body gets the Reflection type Object1. Class name.Do not perform static fast2..class GetClass
Redis is one of the most popular NoSQL systems today, and it is a key-value storage system. Similar to memcached, but largely compensates for the lack of memcached, which supports storing more value types, including string, list, set, Zset, and hash.
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:
Phpredis is an extension of PHP, and the efficiency is quite high. It provides the linked list sorting function to create memory-level module business relationships.
Useful. The following are the command tips officially provided by redis:
1. Download and install
CD/TMPWgetHTTP://Redis.googlecode.com/files/redis-2.2.13.tar.gzTar-Zxf redis-2.2.13.Tar. Gzcd redis-2.2.13MakeSudo Make Install
In this case, the redis executable file is stored in/usr/local/bin.
2. Download the
RedisApsaradb for redis provides a wide range of data types. Compared with relational databases or simple key-value storage (such as memcached), apsaradb for redis data models are more similar to actual data models. For exampleFriend relationshipThe
# By default redis does not run as a daemon. use 'yes' if you need it. # note that redis will write a PID file in/var/run/redis. PID when daemonized. # redis does not run in daemon mode by default. You can modify this configuration item and use yes
In brief, writing this article is a summary of your recent work. I hope it will be helpful and a little bit of accumulation.
I. Why redis?
Redis is used as the cache in the project and memcache is not yet used. There are two main considerations:
I. redis Memory Management
Redis is a memory-based Key-value database, and its memory management is very important. In order to shield the differences between different platforms and count the memory usage, redis encapsulates memory allocation
Redis is not a mature alternative to memcache or MySQL, but a good complement to the architecture of large-scale Internet applications. More and more applications are also making architecture changes based on redis. redis has released cluster
Redis supports the publish/subscribe message queue mechanism. Jedis provides a Java client to access redis. This article describes how to use Jedis to implement simple message queues and transmit objects.
Redis supports publishing and subscription.
Redis currently provides an asynchronous master-slave replication version system. Redis provides several methods to do this. Master-slave replication mainly corresponds to the redis/replication. c file. The source code framework consists of three
Request/response protocol and RTT
Redis is a client/server model (also calledRequest/ResponseProtocol.
This indicates that the implementation of one request involves the following steps:
The client sends a request to the server and reads the
=====================Four or five types (sorted and unordered sets): sets (that is, sets) ==================
1. Introduction: Set indicates a set, which is randomly added -----> unordered set.
Set is a collection, which is an unordered set of the
RedisKey-value nosql, dedicated to thoseSmall and hotData, typical "Lori control"What is key-value? From the perspective of RDBMS, let alone one word:Key: primary key columnValue: other columnsRedis has been very popular in recent years, and it has
The redis management script is based on the Ubuntu release. For Ubuntu users, you can refer to this Article. Ubuntu installation and startup of redis are not available on centos Linux. The following script can be used for centos:
Before using this
Common redis Data Types
Redis has the following data types:
String
Hash
List
Set
Sorted set
Before describing these data types, let's take a look at how redis's internal memory management describes these different data types:
First, redis
Redis boot script Centos6.51. Install Redis1 and download the source code. decompress the package and compile the source code.
# wget http://download.redis.io/releases/redis-2.8.3.tar.gz# tar xzf redis-2.8.3.tar.gz# cd redis-2.8.3# make2. Go to 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service