当前位置:网站首页>Introduction to redis (1)

Introduction to redis (1)

2022-07-05 01:06:00 W sheep Sean w

Catalog

1. When redis

(1)NoSQL What is it?

(2)NoSQL summary

(3)Redis What is it?

(4)Redis summary

2.Redis The role of

3.Redis Introduction to relevant knowledge

(1)redis stay Linux Start in

(2) sign out redis client

(3) close redis Two methods of

 (4)Redis Database in

(5)Redis Other operations in  

(6)Redis Explanation

   


1. When redis

(1)NoSQL What is it?

NoSQL, A general term for a non-relational database . With the Internet web2.0 The rise of websites , Traditional relational databases are dealing with web2.0 Website , Especially large scale and high concurrency SNS Type of web2.0 Pure already seems unable , There are a lot of insurmountable problems , The non-relational database has developed rapidly due to its own characteristics .NoSQL The emergence of database is to solve the challenge of large data sets and multiple data types , Especially big data application problems .

(2)NoSQL summary

NoSQL(NoSQL = Not Only SQL ), meaning “ not only SQL”, Generally speaking Non relational databases .
NoSQL It doesn't rely on business logic to store , In a simple way key-value Mode storage . Therefore, it greatly increases
Database expansion capability .
a. Non compliance SQL standard .
b. I won't support it ACID.
c. Far beyond SQL Performance of
NoSQL Applicable scenario :
High concurrent reading and writing of data
Read and write massive data
High scalability of data 1.2.3.
NoSQL Not applicable to the scene :
Need transaction support
be based on sql Structured query storage of , Dealing with complex relationships , need Impromptu Inquire about .

(3)Redis What is it?

Redis(Remote Dictionary Server ), Remote dictionary service , Is an open source use ANSIC Language writing 、 Support network 、 Log type that can be memory based or persistent 、Key-Value database , And provide multilingual API.Redis It's a kind of NoSQL;

(4)Redis summary

 1.Redis It's a Open source Of key-value The storage system .

2. and Memcached similar , It supports storage value There are more types , Include string( character string )list( Linked list )set( aggregate )zset(sorted set -- Ordered set ) and hash( Hash type ).

3. These data types support push/popadd/remove And take intersection, union and difference sets and more abundant operations , And these operations are Atomicity Of .
4. On this basis ,Redis Support various ways of Sort .
5. And memcached equally , To ensure efficiency , The data are all Cache in memory in .  
6. The difference is Redis Meeting periodic Yes, put the updated Data written to disk Or write the modification operation to the additional record file .
7. And on this basis It has been realized. master-slave( Master-slave ) Sync

2.Redis The role of

(1) Cache with relational database

(2) A variety of data structures store persistent data

3.Redis Introduction to relevant knowledge

(1)redis stay Linux Start in

a. Front desk login

stay bin Enter the command in the directory redis-server

  At the same time, the front desk display tells us redis The port number of is 6379

b. Backstage login

redis stay Linux The startup command in is redis-server  / route /redis-config

The command to open the client is redis-cli( my redis.conf stay etc Under the table of contents )

               

Among the two startup methods, we choose the background startup method

The front desk starts , The command line window cannot be closed , Otherwise, the server stops

(2) sign out redis client

sign out redis client The order is exit

                

(3) close redis Two methods of

 a. Enter commands directly on the client shutdown

      

b. utilize kill Order to kill redis process kill  -9  PID

 (4)Redis Database in

Default 16 A database , Similar array subscript from 0 Start , Initial default use 0 Signal library Use command select <dbid> To switch databases . Unified password management , All libraries have the same password

(5)Redis Other operations in  

dbsize Check the... Of the current database key The number of
flushdb Empty the current library
flushall Kill all the warehouses

(6)Redis Explanation

 Redis A single thread + multiple IO Multiplexing technology

        

        

   

        

原网站

版权声明
本文为[W sheep Sean w]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050104143611.html