I. Introduction to Redis

* * * *

Redis, a NoSQL database of key-value pair type. It seems to be very simple to use. The operation object is just key-value, and there is no concept of library, table or field at all. Of course, keys can be layered, separated by:, as in gramfather:father:key, which is somewhat similar to the namespace in c#. Superclass. subclass. but that’s not the same thing as library tables. \

\

Assign to the key named name


127.0.0.1:6379> set name “leftfist” 

OK 

Read the value of the key named name

127.0.0.1:6379> Get name “leftFist”

The value type supports characters, lists, sets, ordered sets, and hash tables. Advantages: Fast, rich data types, and simple operation

Disadvantages: Single-threaded architecture, easy CPU bottlenecks, data in memory, the unit of T is not practical in practical applications, Redis is often used as a cache, can replace memcached, but better performance, and can persist.

Two, features list

(3) All data is in memory.

Are responsible for five data structures: String/Hash/List/Set/Ordered Set.

(3) Data expiration time is supported.

(3) Incomplete transaction support.

(3) Server side Script: written in Lua Script, which acts like a stored procedure.

(3) PubSub: A one-to-many publish and subscribe messaging feature that is out of business, at least used by Redis-Sentinel.

(3) Persistent: Supports the Snapshot mode that periodically exports memory and the Append Only File mode that records write operation logs.

Restoring Replication: Master-slave mode. A Master can be connected to multiple read-only slaves. There is no special Geographic Replication support. \

\

Redis does not support Windows directly, but an organization called the Microsoft Open Technology Team is developing and maintaining a variant for 64-bit Windows. That sounds so crazy. Used Redis. So use Redis, or ditch Windows and stick with Linux. 1. On the terminal, enter sudo apt-get update sudo apt-get install redis-server and enter the super administrator password. Note that the network is normal when you run the above command. This is especially important if the network environment requires a proxy.

About proxy Internet setup, can be seen in my book:

Blog.csdn.net/leftfist/ar… Apt-get is a Linux command for DEB package management operating systems, mainly used to automatically search, install, upgrade, uninstall software or operating system from the Internet software repository. The equivalent of nuget in Node.js NPM, vs.net.

2. Check whether Redis runs automatically after installation. In the end, the ps – aux | grep redis among them, the ps command to list system currently running process; Normally, information similar to redis 942 0.0 0.4 27908 7264? Ssl 14:48 0:10 /usr/bin/redis-server *:6379 leftFist 19055 0.0 0.0 4832 920 PTS /8 S+ 18:01 0:00 grep –color=auto redis Open the Redis client. On the terminal, enter Redis -cli. 4

On the Redis client, type info. If you just want to see the redis version number, You can directly enter redis-cli -version or redis-cli -v redis-server -version or redis-server -v in the terminal. 5. On the Redis client, enter keys *

Modify /etc/redis/redis.conf. Sudo vi /etc/redis/redis.conf is a different topic. \