| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,10 +35,28 @@ List 说白了就是链表(redis 使用双端链表实现的 List),一般 | |||
| 35 | 35 | * (1)例如存储全班同学的成绩,其集合value可以是同学的学号,而score就可以是成绩。 | |
| 36 | 36 | * (2)排行榜应用,根据得分列出topN的用户等。 | |
| 37 | 37 | ||
| 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:除上述条件外 | ||
| 39 | 55 | ||
| 40 | - https://www.runoob.com/w3cnote/redis-use-scene.html | ||
| 56 | + 参考文献: | ||
| 41 | 57 | ||
| 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 | ||
| 42 | 60 | ||
| 43 | 61 | ## 23. Redis的持久化机制是什么?各自的优缺点?如何选择合适的持久化方式 | |
| 44 | 62 | * 持久化就是把**内存的数据写到磁盘中去(快照)**,防止服务宕机了内存数据丢失。 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments