当前位置:网站首页>深入底层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。
下图统计周活用户
边栏推荐
- 解决 contents have differences only in line separators
- 含重复元素取不重复子集[如何取子集?如何去重?]
- 瞅一瞅JUC提供的限流工具Semaphore
- Can communication of nano
- 《2022中国信创生态市场研究及选型评估报告》发布 华云数据入选信创IT基础设施主流厂商!
- 分享:中兴 远航 30 pro root 解锁BL magisk ZTE 7532N 8040N 9041N 刷机 刷面具原厂刷机包 root方法下载
- c期末复习
- [utiliser Electron pour développer le Bureau sur youkirin devrait]
- 快速生成ipa包
- English sentence pattern reference
猜你喜欢

Thoroughly understand why network i/o is blocked?

基于can总线的A2L文件解析(3)

Record a case of using WinDbg to analyze memory "leakage"

nano的CAN通信

Huaxia Fund: sharing of practical achievements of digital transformation in the fund industry

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!

Le cours d'apprentissage de la machine 2022 de l'équipe Wunda arrive.

第十一届中国云计算标准和应用大会 | 华云数据成为全国信标委云计算标准工作组云迁移专题组副组长单位副组长单位

瀚升优品app翰林优商系统开发功能介绍

记录Pytorch中的eval()和no_grad()
随机推荐
彻底理解为什么网络 I/O 会被阻塞?
About statistical power
Is it safe to open an account, register and dig money? Is there any risk? Is it reliable?
记录Pytorch中的eval()和no_grad()
The 10th global Cloud Computing Conference | Huayun data won the "special contribution award for the 10th anniversary of 2013-2022"
sample_rate(采样率),sample(采样),duration(时长)是什么关系
Electron安装问题
关于服装ERP,你想知道的都在这里了
JVM third talk -- JVM performance tuning practice and high-frequency interview question record
Generate classes from XML schema
Matlab built-in function how different colors, matlab subsection function different colors drawing
[QNX hypervisor 2.2 user manual]6.3.2 configuring VM
node_exporter内存使用率不显示
[QNX Hypervisor 2.2用户手册]6.3.2 配置VM
vulnhub之darkhole_2
怎么自动安装pythn三方库
RPC协议详解
项目中遇到的问题 u-parse 组件渲染问题
写作写作写作写作
[use electron to develop desktop on youqilin]