当前位置:网站首页>【1】 Introduction to redis
【1】 Introduction to redis
2022-07-28 06:04:00 【ymony】
List of articles
One 、Redis brief introduction
Redis What is it? ?
- Redis It's open source (BSD The license ) Of , Data structure storage system in memory , It can be used as a database 、 Caching and message middleware ;
- Redis Support multiple types of data structures , Such as character string (strings), hash (hashes), list (lists), aggregate (sets), Ordered set (sorted sets) , Range queries , bitmaps, hyperloglogs and Geographical space (geospatial) Index radius query ;
- Redis Built in copy (replication),LUA Script (Lua scripting),LRU Driving events (LRU eviction), Business (transactions) And different levels of Disk persistence (persistence);
- Redis adopt sentry (Sentinel) And clusters (Cluster) Provide high availability (high availability).
Redis characteristic
Fast
- Single node read 110000 Time /s, Write 81000 Time /s
- Data is stored in memory
- use C Language implementation , Closer to the operating system
- Single thread Architecture ,6.0 Start to support multithreading (CPU、IO Read and write load )
Persistence
- Data updates will be saved asynchronously to the hard disk (RDB and AOF)
Multiple data structures - It's not just about supporting simple key-value Type data , And support : character string 、hash、 list 、 aggregate 、 Ordered set ,
Support for multiple programming languages
Rich in functions
- HyperLogLog、GEO、 Publish subscribe 、Lua Script 、 Business 、Pipeline、Bitmaps,key Be overdue
Simple and stable
- Less source code 、 Single thread model
Master slave copy
Redis Support data backup (master-slave) With clusters ( Fragmentation storage ), And have a sentinel monitoring mechanism .
Redis All operations of are atomic , meanwhile Redis It also supports atomic execution after several operations are combined
Redis Typical usage scenarios
cache
Counter (inc command )
Message queue ( General message queues use special middleware ),
Ranking List ( Ordered set implementation )
Social networks ( give the thumbs-up , And so on , Social network traffic is generally large , Traditional relational database is not suitable )
Distributed session ( So much tomcat share session)
Distributed lock
Redis High concurrency principle
- Redis Is a pure memory database , It's usually a simple access operation , Threads take up a lot of time , The time spent is mainly focused on IO On , So the reading speed is fast
- Redis Use non blocking IO,IO Multiplexing , Single thread used to poll descriptor , Open database 、 Turn off 、 read 、 Write all converted to events , Reduce context switching and competition during thread switching .
- Redis Single thread model is adopted , Ensure the atomicity of each operation , It also reduces context switching and competition of threads .
- Redis Storage structure diversification , Different data structures optimize data storage , For example, compressed table , Compress and store short data , Again , Jump watch , Use ordered data structure to speed up reading .
- Redis Using the event separator realized by ourselves , High efficiency , Non blocking internal execution , Large throughput .
Article reference :https://mp.weixin.qq.com/s/-3fcK4WspGk6SEsaVrdx8A
边栏推荐
- JS promise implementation logic
- Sorting and paging, multi table query after class exercise
- 南京邮电大学CTF题目writeup (一) 含题目地址
- 区分实时数据、离线数据、流式数据以及批量数据的区别
- Mars数*字*藏*品*平*台守卫者计划细节公布
- On how digital collections and entities can empower each other
- 排序与分页,多表查询课后练习
- Apache Log4j任意代码执行复现
- Flume installation and use
- tcp和udp的区别和联系
猜你喜欢
随机推荐
Sorting and paging, multi table query after class exercise
第七章 单行函数
Phoenix
Sort method for sorting
文件上传漏洞总结
How digital library realizes Web3.0 social networking
万变不离其宗-掌控者靶场之bluecms1.6漏洞
Sqoop安装及使用
进程线程协程的区别
DataX installation and use
【四】redis持久化(RDB与AOF)
Flex elastic box item properties
数字藏品成文旅产业新热点
(php毕业设计)基于thinkphp5校园新闻发布管理系统获取
Assembly打包
Linux(centOs7) 下安装redis
记录下在线扩容服务器遇到的问题 NOCHANGE: partition 1 is size 419428319. it cannot be grown
Mars number * word * Tibet * product * Pingtai defender plan details announced
Flume installation and use
Books - mob









