当前位置:网站首页>Redis - basic concept
Redis - basic concept
2022-07-24 01:04:00 【JiawenZhang97】
List of articles
One 、NoSQL summary
1. Why NoSQL
- stand-alone MySQL The s
- Memcached( cache )+ MySQL + Split Vertically ( Read / write separation )
- Sub database and sub table + Horizontal split + MySQL colony
- Now, in the latest era
- MySQL Such relational databases are not enough , Large amount of data , Fast change

- MySQL Such relational databases are not enough , Large amount of data , Fast change
Why use NoSQL
User's personal information , Social networks , Location . User generated data , User logs and so on exploded .
And that's where we need to use it NoSQL database , It can handle the above situation well .
2. What is? NoSQL
NoSQL = Not Only SQL
- Non relational database in general . Traditional relational databases are difficult to deal with web2.0 Time . Especially in large-scale high concurrency communities .
3. NoSQL characteristic
- Easy to expand ( There's no relationship between the data , Good extension )
- Large data volume and high performance (NoSQL The cache is record level , Fine grained cache , High performance )
- Data types are diverse ( There's no need to design the database in advance , Take it and use it )
- Traditional relational databases (RDBMS) and NoSQL
Conventional RDBMS
Structured organization ;
SQL;
Data and relationships exist in separate tables ;
Strict consistency ;
Basic business
NoSQL
It's not just data
There is no fixed query language
Key value pair storage , Column store , Document storage , Graphic database
Final consistency
CAP Theorem and BASE ( Different live )
High performance , High availability , Highly scalable
4. NoSQL The four major categories of
- KV Key value pair
- Redis
- Document database (bson Format )
- MongoDB( Is a database based on distributed file storage , Used to process a large number of documents )
- Column store database
- HBase
- Graph relational database
- What you save is not graphics , It's the relationship
- Neo4j
Two 、Redis summary
1. What is? Redis
- Redis(Remote Dictionary Server), Remote Dictionary Service ;
- The hottest thing right now NoSQL One of the technologies , Also known as structured database ;
2. Redis purpose
- Memory storage 、 Persistence ;
- Efficient , For caching ;
- Publish subscribe system ;
- Map information analysis ;
- timer 、 Counter ( Browse volume )
3、 ... and 、Redis install
Official website :https://redis.io/
( Be careful :Windows The needs of the system are github Upload and download , because Redis Recommended in the Linux To build )
【 The following is about Windows Next installation steps 】
Download installation package
link :https://pan.baidu.com/s/1h5pwR64SvjCz2_6JRNDGJw
Extraction code :yt9h
- Unzipped installation package

- Open command window , Switch directory to current folder , Then enter the following command :
redis-server redis.windows.conf
The default port is :6379
- Do not close the previous window , Double-click to open redis-cli.exe

Enter the following to test
Four 、Redis Basic knowledge of
- redis The default is 16 A database , By default, the first one is 0 individual ;
- redis It's single threaded , It's memory based ;
- redis The performance bottleneck is not CPU, It's the memory and network bandwidth of the machine ;
- redis Why is single thread so fast
- High performance servers are not necessarily multi-threaded ;
- Multithreading involves CPU Context switch ;
- The core :redis It puts all the data in memory , So using single thread operation is the most efficient . Multithreading will have CPU Context switching takes time . For memory , If there is no context switching, the efficiency is the highest . Read and write many times in a CPU Upper , In the case of memory , This plan is the best .
5、 ... and 、Redis Five basic data types
Redis Case insensitive commands
1. String String type


2. List List the type
- stay redis in , have access to List To express Stack 、 queue 、 Blocking queues ;
- List The command , With
LThe beginning represents left operation , WithRThe beginning represents right operation ;



3. Set Collection types
- Set All commands in are in
SAt the beginning ;



4. Hash Hash type
- Map aggregate ,key-map;
- This value is a Map aggregate , The nature and String There's not much difference between types , It's still a simple key-value;

5. Zset Ordered set type
- stay set On the basis of , Added a value ;
- set k1 v1 zset k1 score1 v1


6、 ... and 、Redis Three special data types
1. Geospatial Geographical location details
- Friends' positioning , The man near the , Taxi distance calculation ;
getpos: Get the current location : It must be a coordinate value
geodist: The distance between the two
georadius: Get people nearby ( Query by radius )
2. Hyperloglog Base Statistics
3. Bitmap Bitmap scene operation
边栏推荐
- Establishment of static route
- Deep understanding of collaborative process
- Basic use of crawler requests module
- Idea hot deployment (hot load)
- The way to access global variables in multi-source file mode (extern usage)
- T-seda code
- Notes to Chapter 2 of kubernetes in action
- OSI open system interconnection model and tcp/ip model
- Determination of host byte order
- IDEA设置 自动导包删无用包
猜你喜欢

Project scenario: NVIDIA SMI unable to datemine the device handle for GPU 0000:01:00.0: unknown error

Solve the error: uncaught (in promise) navigationduplicated: avoided redundant navigation to current location:“

Idea hot deployment (hot load)

Dynamic rip configuration

SkyWalking分布式系统应用程序性能监控工具-上

The salary of a tester who has worked for 3 years after job hopping is twice that of the original. The secret is

Axure implements addition, deletion, modification and query

Sublime text 3 Chinese + add common plug-ins

Matlab extracts the original data in the illustrations of the paper - fig2data tool

T-seda code
随机推荐
This is a big problem
VLAN division, automatic allocation of IP to all hosts through DHCP, and communication accessible throughout the network
LVS load balancing scheduling principle and configuration method
Dynamic rip configuration
Tutorial on principles and applications of database system (047) -- MySQL query (IX): connection query
MySQL interview questions
MySQL exercise: all employees reporting to the CEO
Client does not support authentication protocol requested by server; consider upgrading MySQL client
Static extension configuration
Matlab extracts the original data in the illustrations of the paper - fig2data tool
Implementation of singleton mode and prevention of reflection and serialization
爬虫requests模块的基本使用
WinVerifyTrust调用返回80096005错误,时间戳签名或证书无法验证或已损坏
Pbootcms database conversion tutorial (SQLite to MySQL detailed tutorial)
scroll-view实现下拉刷新(避免onload进入页面初始refresher-triggered为true触发下拉问题)
The way to access global variables in multi-source file mode (extern usage)
C language force deduction question 53 of the largest subarray sum. Dynamic programming and divide and conquer
Tutorial on principles and applications of database system (045) -- MySQL query (VII): aggregate function
VIM common commands
Bubble sort, quick sort