Redis- Introduction and basic data types

A, Redis Introduction

1.1, related products and compare nosql

1.1.1、Memcached

Advantages: High performance read, a single data type, client support distributed cluster type, the hash consistency, a multi-core structure, a high performance multi-threaded read-write.

Cons: No persistence , caching node failure may occur penetrate, distributed client needs to achieve data synchronization across the room difficult, complex architecture and high expansion

1.1.2 Redis

Advantages: High-performance reading and writing, support multiple data types, data persistence, high-availability architecture, support for custom virtual memory, support for distributed cluster fragmentation, high performance read and write single-threaded

Disadvantages: read and write multi-threaded slower than Memcached

Application Enterprise: Sina, Jingdong, live class platform, web games

1.1.3, Three

Advantages: High-performance read and write, supports three storage engine (ddb, rdb, ldb), support high availability, support for distributed cluster fragmentation, caching support almost all Taobao business.

Cons: Stand-alone case, read and write performance is slower than the other two products

image

1.1.4, read and write performance comparison

memcached: suitable for multi-user access, a small amount of each user rw

redis: suitable for a small user access, each user a lot rw

image

imageimage

image

1.1.5, using contrast scenes

Memcached: multicore cache service, more suitable for the small number of multi-user concurrent access scenarios

Redis: single-core cache service, single-node case, more suitable for small number of users, application scenarios multiple visits.

Redis is generally stand-alone multi-instance architecture, with redis clusters appear .

1.2, redis Features

1) Redis is an open source, written in ANSI C language, high-key (key-value) caching and persistent storage NoSQL database products support

2) Redis With memory (In-Memory) data set (the DataSet)

3) support a variety of data types

4) run on most POSIX systems, such as Linux, * BSD, OS X, etc.

5) Author: Salvatore Sanfilippo

The main function:

  1. High-speed read and write
  2. Rich data types
  3. Support persistence
  4. A variety of memory allocation and recovery strategies
  5. Support Services
  6. Message queue, the message subscribe
  7. Support high availability
  8. Support for distributed cluster fragmentation

1.3, redis scenarios

1) Data Cache

2) web session cache (session cache)

3) Application Leaderboard

4) the message queue

5) publish and subscribe

1.4, redis reference document

1) redis.io

2) download / redis.io

3) redisdoc.com

4) redis.cn

Two, Redis Installation and Configuration

Guess you like

Origin www.cnblogs.com/hujinzhong/p/11620122.html