FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update 4_数据结构、持久化、双写一致性.md · SpartaHao/JavaTechnologyStack@7f4106f · GitHub

Commit 7f4106f

Browse files
authored
Update 4_数据结构、持久化、双写一致性.md
1 parent c1aa3c6 commit 7f4106f

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

‎redis/4_数据结构、持久化、双写一致性.md‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,28 @@ List 说白了就是链表(redis 使用双端链表实现的 List),一般
3535
* (1)例如存储全班同学的成绩,其集合value可以是同学的学号,而score就可以是成绩。
3636
* (2)排行榜应用,根据得分列出topN的用户等。
3737

38-
参考文献:
38+
### 底层实现
39+
* 字符串的编码类型
40+
int:8 个字节的长整型
41+
embstr:小于等于 39 字节的字符串
42+
raw:大于 39 字节的字符串
43+
* 哈希的编码类型
44+
ziplist:元素个数小于 512,且所有值都小于 64 字节
45+
hashtable:除上述条件外
46+
* 列表的编码类型
47+
ziplist:元素个数小于 512,且所有值都小于 64 字节
48+
hashtable:除上述条件外
49+
* 集合的编码类型
50+
intset:元素个数小于 512,且所有值都是整数
51+
hashtable:除上述条件外
52+
* 有序集合的编码类型
53+
ziplist:元素个数小于 128,且所有值都小于 64 字节
54+
hashtable:除上述条件外
3955

40-
https://www.runoob.com/w3cnote/redis-use-scene.html
56+
参考文献:
4157

58+
https://www.runoob.com/w3cnote/redis-use-scene.html
59+
https://mp.weixin.qq.com/s?__biz=Mzk0MjE3NDE0Ng==&mid=2247483866&idx=1&sn=d426cb1c3a4f754d560af044b9e00f2c&source=41#wechat_redirect
4260

4361
## 23. Redis的持久化机制是什么?各自的优缺点?如何选择合适的持久化方式
4462
* 持久化就是把**内存的数据写到磁盘中去(快照)**,防止服务宕机了内存数据丢失。

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL