当前位置:网站首页>Redis common sense
Redis common sense
2022-07-01 11:22:00 【Daily enlightenment】
disk :
(1) Addressing ms (2) bandwidth ( How much data flow per unit time )ns
Memory :
(1) Addressing ns The disk is slower than the internal address 10w times
I/O buffer: The question of cost
A disk has tracks and sectors : One sector 512Byte The cost of indexing increases
When formatting the disk, there is a 4K alignment : Read less than 4K Of , return 4K
No matter how much you read from the disk , It's all the least 4K
The data in the file , As the file gets bigger , Slow down ( The file gets bigger , Hard disk (i/o) Become a bottleneck )
data page ( size 4K)
Index building , Speed up
Create tables for relational databases , Must give schema( Columns of the table , The type of each column ), The width of each row of data is fixed , Prefer row level storage .
There is one in memory B+ Trees , leaf (data page), The trunk is also in memory
SQL Of where In the condition of , Just hit the index , Inquire about B+ The tree will walk the trunk , Find the leaves , Read from disk to memory .
( Index in memory , It will cause insufficient memory , So the index and data are on disk )
The table of the database is very large , Performance will become lower ?
If the table has an index , Add, delete and change will slow down .
Queries are slower ?
(1)1 One or a few queries are still very fast
(2) When the concurrency is large, the speed will be affected by the bandwidth of the hard disk
Large amount of data , How to quickly query the database
( disk 、 Memory compromise ) cache :memcached、redis
Computer system 2 Infrastructure : The hardware of von Neumann system 、 Ethernet and TCP/IP Network of
The volume of disk and memory are different : There is no pointer concept in the disk
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 .
It supports multiple types of data structures , Such as character string (strings), hash (hashes), list (lists), aggregate (sets), Ordered set (sorted sets) And scope query , 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), And pass Redis sentry (Sentinel) And automatic Partition (Cluster) Provide high availability (high availability).
Redis:
key:
value:String( Character type 、 value type )、hashes、lists、sets、sorted sets、bitmaps
Client fetch v One of the elements in ,redis Of server There are methods for each type in (index()、lpop)
memcached(key,value):value There is no concept of type
Client fetch v One of the elements in , return value All data to client( adopt server network card IO), The client should have the code you implement to save code
边栏推荐
- tmux使用
- kubernetes之ingress探索实践
- sdp 协议中的packetization-mode方式和三种流传输模式
- 金融壹账通拟7月4日香港上市:2年亏近30亿 市值蒸发超90%
- Mingchuang plans to be listed on July 13: the highest issue price is HK $22.1, and the net profit in a single quarter decreases by 19%
- Unittest框架中测试用例编写规范以及如何运行测试用例
- 分享psd格式怎么预览的方法和psd文件缩略图插件[通俗易懂]
- Mysql的四个隔离级别是如何实现的 (简要)
- 树莓派4B安装tensorflow2.0[通俗易懂]
- Spam filtering challenges
猜你喜欢
CVPR 2022 | 基于密度与深度分解的自增强非成对图像去雾
为什么一定要从DevOps走向BizDevOps?
2022/6/30学习总结
Spam filtering challenges
CAD如何设置标注小数位
京东与腾讯续签合作:向腾讯发行A类股 价值最高达2.2亿美元
redis配置环境变量
Ten years of sharpening a sword: unveiling the secrets of ant group's observability platform antmonitor
Technology sharing | introduction to linkis parameters
China's cellular Internet of things users have reached 1.59 billion, and are expected to surpass mobile phone users within this year
随机推荐
"Target detection" + "visual understanding" to realize the understanding and translation of the input image (with source code)
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
Test case writing specification in unittest framework and how to run test cases
華為設備配置大型網絡WLAN基本業務
Oracle和JSON的結合
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
TMUX usage
达梦数据冲刺科创板:拟募资24亿 冯裕才曾为华科教授
MySQL IN 和 NOT IN () 空列表报错
Can I open a securities account anywhere? Is it safe to open an account
When is testing not unit testing- When is a Test not a Unit-test?
Tempest HDMI leak reception 4
Development overview of fund internationalization
银行卡借给别人是否构成犯罪
证券账户随便哪里开都能使用吗 开户安全吗
Graduation season · advanced technology er
Shangtang entered the lifting period: the core management voluntarily banned and strengthened the company's long-term value confidence
放弃深圳高薪工作回老家
How to make the development of liquidity pledge mining system, case analysis and source code of DAPP defi NFT LP liquidity pledge mining system development
Export and import of incluxdb on WIN platform