当前位置:网站首页>[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 !
边栏推荐
- Leecode-c language implementation -15 Sum of three ----- ideas to be improved
- Onie supports pice hard disk
- Sélectionnez toutes les lignes avec un symbole dans Word et changez - les en titre
- Typescript interface and the use of generics
- [cf gym101196-i] waif until dark network maximum flow
- How can word delete English only and keep Chinese or delete Chinese and keep English
- 洛谷P1836 数页码 题解
- Brief explanation of instagram operation tips in 2022
- [window] when the Microsoft Store is deleted locally, how to reinstall it in three steps
- qt颜色与字符串、uint相互转换
猜你喜欢
继电反馈PID控制器参数自整定
. Net 6 learning notes: what is NET Core
octomap averageNodeColor函数说明
数字经济时代,如何保障安全?
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
软件测试界的三无简历,企业拿什么来招聘你,石沉大海的简历
Ble of Jerry [chapter]
Sharing of source code anti disclosure scheme under burning scenario
Risk planning and identification of Oracle project management system
How to delete all the words before or after a symbol in word
随机推荐
Basics of reptile - Scratch reptile
Document 2 Feb 12 16:54
Brief explanation of instagram operation tips in 2022
How MySQL merges data
Emo diary 1
opencv学习笔记八--答题卡识别
WebRTC系列-H.264预估码率计算
. Net 6 learning notes: what is NET Core
octomap averageNodeColor函数说明
C # connect to SQLite database to read content
Bit operation XOR
软件开发的一点随记
Is the super browser a fingerprint browser? How to choose a good super browser?
Launch APS system to break the problem of decoupling material procurement plan from production practice
Force buckle day31
Leecode-c language implementation -15 Sum of three ----- ideas to be improved
剪映的相关介绍
实现精细化生产, MES、APS、ERP必不可少
链表面试题(图文详解)
Simulation of holographic interferogram and phase reconstruction of Fourier transform based on MATLAB