当前位置:网站首页>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
边栏推荐
- Oracle和JSON的结合
- Graduation season · advanced technology er
- 名创拟7月13日上市:最高发行价22.1港元 单季净利下降19%
- (POJ - 1456) supermarket
- 获取键代码
- 全局过滤器(处理时间格式)
- 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
- Unittest框架中跳过要执行的测试用例
- Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
- CVPR22 |CMT:CNN和Transformer的高效结合(开源)
猜你喜欢
Huawei Equipment configure les services de base du réseau WLAN à grande échelle
Shangtang entered the lifting period: the core management voluntarily banned and strengthened the company's long-term value confidence
Y48. Chapter III kubernetes from introduction to mastery -- pod status and probe (21)
CPI教程-异步接口创建及使用
The project bar on the left side of CodeBlocks disappears, workspace automatically saves the project, default workspace, open the last workspace, workspace (Graphic tutorial, solved)
Unittest 框架介绍及第一个demo
Brief analysis of edgedb architecture
applyMiddleware 原理
Tempest HDMI leak reception 4
Tianrunyun, invested by Tian Suning, was listed: its market value was 2.2 billion Hong Kong, and its first year profit decreased by 75%
随机推荐
Intel Labs announces new progress in integrated photonics research
Cvpr22 | CMT: efficient combination of CNN and transformer (open source)
力扣(LeetCode)181. 超过经理收入的员工(2022.06.29)
今天开户今天能买股票吗?在线开户是很安全么?
Neurips 2022 | cell image segmentation competition officially launched!
Can I open a securities account anywhere? Is it safe to open an account
Can I open an account today and buy stocks today? Is it safe to open an account online?
TEMPEST HDMI泄漏接收 3
Several cases of index failure
Are the consequences of securities account cancellation safe
Y48. Chapter III kubernetes from introduction to mastery -- pod status and probe (21)
Ten years of sharpening a sword: unveiling the secrets of ant group's observability platform antmonitor
优雅地翻转数组
内核同步机制
redis中value/list
Brief analysis of edgedb architecture
Tempest HDMI leak receive 5
Graduation season · advanced technology er
openinstall:微信小程序跳转H5配置业务域名教程
[buuctf.reverse] 144_[XMAN2018排位赛]easyvm