当前位置:网站首页>深入底层C源码讲透Redis核心设计原理
深入底层C源码讲透Redis核心设计原理
2022-07-05 18:23:00 【bingtanghulu_6】
目录
1.redis基本特性
2.redis应用场景
3.数据结构
3.1 string
redis中都是k-v结构,key在底层都是string结构,value有string,hash,set,sorted set,list等。
其中string中的数据结构如下,3.2之前只有三个参数len(字符长度),free(空闲空间),buf[](存储变量)
redis中string字符串的三个特性
1.二进制安全的数据结构
c语言在string str='xxx\0';字符串这样的结构时以一个\0代表结尾。
2.提供了内存预分配机制,避免了频繁的内存分配
提供扩容机制,算法:(len+addlen)*2
3.兼容C语言的函数库。
bitmap底层使用string,string字符串能代表的最大长度512M。
下图统计周活用户
边栏推荐
- 《ClickHouse原理解析与应用实践》读书笔记(5)
- ConvMAE(2022-05)
- node_ Exporter memory usage is not displayed
- buuctf-pwn write-ups (9)
- buuctf-pwn write-ups (9)
- 金太阳开户安全吗?万一免5开户能办理吗?
- English sentence pattern reference
- Personal understanding of convolutional neural network
- 【在優麒麟上使用Electron開發桌面應】
- Reptile 01 basic principles of reptile
猜你喜欢
如何获取飞机穿过雷达两端的坐标
Insufficient picture data? I made a free image enhancement software
LeetCode 6109. 知道秘密的人数
记一次使用Windbg分析内存“泄漏”的案例
Image classification, just look at me!
The 2022 China Xinchuang Ecological Market Research and model selection evaluation report released that Huayun data was selected as the mainstream manufacturer of Xinchuang IT infrastructure!
pytorch yolov5 训练自定义数据
Vulnhub's darkhole_ two
LeetCode 6111. 螺旋矩阵 IV
ConvMAE(2022-05)
随机推荐
New words new words new words new words [2]
爬虫01-爬虫基本原理讲解
vs2017 qt的各种坑
The 10th global Cloud Computing Conference | Huayun data won the "special contribution award for the 10th anniversary of 2013-2022"
[paddlepaddle] paddedetection face recognition custom data set
写作写作写作写作
快速生成ipa包
What is the reason why the video cannot be played normally after the easycvr access device turns on the audio?
Is it safe for Apple mobile phone to speculate in stocks? Is it a fraud to get new debts?
The origin of PTS, DTS and duration of audio and video packages
ConvMAE(2022-05)
Writing writing writing
Electron安装问题
Can communication of nano
c期末复习
How to choose the most formal and safe external futures platform?
SAP 特征 特性 说明
websocket 工具的使用
lombok @Builder注解
IDEA配置npm启动