当前位置:网站首页>Redis (I) - redis quick start
Redis (I) - redis quick start
2022-07-21 21:12:00 【Super_ Leng】
List of articles
One 、 First time to know Redis
1. Redis Brief introduction
- Redis Born in 2009 The full name of the year is Remote Dictionary Server Remote Dictionary Service device , It's a Memory based Of Key value type NoSQL database .
features :
- Key value (key-value) type ,value Support a variety of different data structures , Rich in functions
- Single thread , Every command is atomic (Redis 6 Multithreading is only for network request processing )
- Low latency , Fast ( Memory based 、IO Multiplexing 、 Good coding (C Language writing )).
- Support data persistence
- Support the master-slave cluster 、 Fragmentation cluster
- Support for multilingual clients
Key value type , Refer to Redis The data stored in is in key、value Form storage of , and value There are many kinds of forms , Can be a string 、 The number 、 even to the extent that json etc. .
2. SQL And NoSql contrast
- NoSql Can translate Not Only Sql( not only SQL), Or is it No Sql( Not Sql Of ) database . Compared with traditional relational database , A special database with great differences , So it's also called Non relational database .
2.1 Structured vs. unstructured
- SQL Traditional relational databases are structured data , Every table has strict constraint information : Field name 、 Field data type 、 Information such as field constraints , The inserted data must comply with these constraints
- NoSQL There are no strict restrictions on the database format , Often the form is loose , free . It can be key value type (Redis)、 Document type (MongoDB)、 Column valued type (HBase)、Graph Pattern (Neo4j)
2.2 Related and non related
- There are often associations between tables in traditional databases , For example, foreign key :
- There is no association relationship in non relational database
- But it can go through json Document nesting , for example : The relationship between users and orders , But there will be redundant data ( Zhang San has this order , Li Si may also have duplicate orders )
2.3 SQL Query and non SQL Inquire about
- Traditional relational databases will be based on Sql Statement to query , The grammar is fixed , You can use the same statement to query
- The query syntax of non relational databases varies greatly
2.4 Business
- Traditional relational database can meet the transaction ACID Principles , High safety
- Non relational databases often do not support transactions , Or it cannot be strictly guaranteed ACID Characteristics of , Only basic consistency can be achieved (BASE theory )
3. Summary
- storage
- Relational databases are stored on disk , There will be a lot of disks IO, Has a certain impact on Performance
- Non relational database , It mainly depends on memory to operate , Memory is very fast in reading and writing , So the performance is good
- Extensibility
- The relational database cluster mode is generally master-slave , Master slave data is consistent , Play the role of data backup , Called vertical expansion .
- Non relational databases can split data , Stored on different machines , It can save huge amounts of data , Solve the problem of limited memory size . Called horizontal expansion .
- Relational database because of the association between tables , Horizontal expansion will bring a lot of trouble to data query .
边栏推荐
猜你喜欢
在 MySQL 和 PostgreSQL 中存储三元数据
25. [method of judging whether it is a prime number]
Picture horizontal waterfall flow
[authority promotion] search ideas and utilization methods of raising rights exp
并发编程(三十一) - ReetrantReadWriteLock 读写锁原理
浅析 SQL Server 的 CROSS APPLY 和 OUTER APPLY 查询 - 第二部分
2021-10-23
Concurrent programming (XX) -reentrantlock locking and unlocking principle
Simulate the implementation of string functions and memory functions (strlen, strcpy, strstr, memcpy
实操演练 | 数据库中检索奇数或偶数行的简单方法
随机推荐
2021-10-23
Solana项目学习(二): Escrow
实操演练 | 将 MySQL 表导出到 CSV
2021-08-11
SQL select 语句
Easy language learning notes (I)
Solana Account 详解
Express+ejs+swagger-ui-dist create timely and updated rest API online interface documents
Uniswap计算过程推演
Add whitelist function for NFT based on Merkle tree (translation)
Redis (VII) - encapsulate redis tool classes
Interview question 17.04 in leetcode Disappearing numbers and 27 Removing Elements
并发编程(二十七) - JUC之原子类
Solidity中的mapping为何不提供按照key遍历的功能?
实操演练 | 数据库中检索奇数或偶数行的简单方法
J'ai besoin d'écrire un titre.
Character function and string function and their simulation implementation (C language)
Peoplesoft- 警告、错误、消息盒子
SQL 汇总数据
Metaforce: my view on the force meta universe, I will teach you to quickly understand the sliding mechanism