当前位置:网站首页>[redis] Introduction to NoSQL database and redis
[redis] Introduction to NoSQL database and redis
2022-07-06 07:42:00 【Decade0712】
One 、NoSQL database
1、NoSQL The definition of
NoSQL Meaning for Not Only SQL( not only SQL), Non relational database in general
Different from relational databases , It does not rely on business logic to store associated data , But rather key-value Data storage in the form of key value pairs , It greatly increases the expansion ability of the database
2、NoSQL The role of database
- Use as cache , Improve access speed , Reduce IO Read operation
- Reduce CPU and IO The pressure of the , Read data directly from memory
3、NoSQL The characteristics of database
- Non compliance SQL Standards for
- I won't support it ACID
A (Atomicity) Atomicity
C (Consistency) Uniformity
I (Isolation) independence
D (Durability) persistence - Far exceed SQL Performance of
4、 Applicable scenario
- High concurrency of data reading and writing , For example, the second kill operation of e-commerce
- Need to read and write massive amounts of data
- High scalability requirements for data
5、 Not applicable to the scene
- Need transaction support
- be based on sql Structured query storage of , Dealing with complex relationships , You need to make an ad hoc inquiry ( Ad hoc inquiry (Ad Hoc) Users according to their own needs , Flexible selection of query conditions )
6、 common NoSQL database
- Redis
- MongoDB
Two 、redis Database introduction
1、 Concept
redis It's open source key-value The storage system
It stores value Five data formats are supported : Include string( character string )、list( Linked list )、set( aggregate )、zset(sort set, Ordered set ) and hash( Hash type )
2、redis You can store data in memory , You can also write data to disk periodically ( Persistence ), In addition, it also realizes master-slave( Master-slave ) Sync
3、 install redis
Get into redis Official website : Download address
Find the latest stable version redis, Download to local , Then upload the compressed package to Linux In the virtual machine , Then start our installation
install C Language compiling environment , Use command
yum install gcc
After installation , Command view gcc editiongcc --version
Use the unzip command to unzip the compressed package to the specified path
Be careful Here's one -C This parameter , Otherwise, there may be Not found in archive This mistakeUse make Command to compile
Use
make PREFIX=xxx( Specify the path ) install
Command to installGo to the installation directory bin View under the path
reids-benchmark: Performance testing tools
redis-check-aof: Fix the problem aof file
redis-check-dump: Fix the problem dump.rdb
redis-sentinel:redis Cluster use
redis-server:redis Server start command
redis-cli:redis clientTry the foreground startup redis( Not recommended , Because after exiting redis The server will also shut down )
If an error is reported
At this time, you have to enter the command , Build a /usr/bin/redis-server To /opt/decade/redis/bin/redis-server The soft links , You're running /usr/bin/redis-server Is running /opt/decade/redis/bin/redis-serverln -s /opt/decade/redis/bin/redis-server /usr/bin/redis-server
Can start normally redis 了Try to start in the background redis
First we will redis Extract... From the directory redis.conf Copy a copy and put it in a path , I am here /opt/decade/cp redis.conf /opt/decade/redis.conf
Usevi redis.conf
Modify the copied one redis.conf, adjustment daemonize Configuration item , from NO Change it to YES( Inputvi redis
after , have access to/ What to look for
To quickly find what you are looking for )
daemonize Is used to specify redis Do you want to start it as a daemonic thread , thus redis It will run in the background
Then we go back to redis Installation directory , Start... With the specified profile redis, You can see ,redis Running in the backgroundTry starting the client
Useredis-cli
Command start clientclose redis
Use it directly kill -9 redis Process number
Input at the client shutdown
Useredis-cli shutdown
Useredis-cli -p redis Port number shutdown
If there is a mistake , Welcome to correct !
边栏推荐
- Solution: système de surveillance vidéo intelligent de patrouille sur le chantier
- Ble of Jerry [chapter]
- [cf gym101196-i] waif until dark network maximum flow
- Jerry's general penetration test - do data transmission with app Communication [article]
- Typescript interface and the use of generics
- Full Score composition generator: living on code
- Get/post/put/patch/delete meaning
- Qualitative risk analysis of Oracle project management system
- Related operations of Excel
- Position() function in XPath uses
猜你喜欢
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Key value judgment in the cycle of TS type gymnastics, as keyword use
JMeter performance test steps practical tutorial
[MySQL learning notes 30] lock (non tutorial)
学go之路(一)go的基本介绍到第一个helloworld
Sharing of source code anti disclosure scheme under burning scenario
861. Score after flipping the matrix
Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master
Related operations of Excel
Compliance and efficiency, accelerate the digital transformation of pharmaceutical enterprises, and create a new document resource center for pharmaceutical enterprises
随机推荐
QT color is converted to string and uint
The way to learn go (II) basic types, variables and constants
Mise en œuvre du langage leecode - C - 15. Somme des trois chiffres - - - - - idées à améliorer
MEX有关的学习
. Net 6 learning notes: what is NET Core
Description of octomap averagenodecolor function
861. Score after flipping the matrix
How to delete all the words before or after a symbol in word
opencv学习笔记九--背景建模+光流估计
leecode-C語言實現-15. 三數之和------思路待改進版
Typescript function definition
继电反馈PID控制器参数自整定
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
The difference between TS Gymnastics (cross operation) and interface inheritance
Three no resumes in the software testing industry. What does the enterprise use to recruit you? Shichendahai's resume
Ble of Jerry [chapter]
Ali's redis interview question is too difficult, isn't it? I was pressed on the ground and rubbed
Games101 Lesson 7 shading 1 Notes
Linked list interview questions (Graphic explanation)
Rust language - receive command line parameter instances