编辑
2023-11-16
Redis源码阅读
00

复制方式

  • 全量复制:传输RDB文件
  • 增量复制:传递断连时的命令
  • 长连接同步:主节点收到的请求发送给从节点

主从复制四大阶段

1.初始化阶段

  • 方式1:从库执行 replicaof masterip masterhost
  • 方式2:从库配置文件replicaof masterip masterhost
  • 方式3:从库设置启动参数-replicaof masterip masterhost
编辑
2023-11-16
Redis源码阅读
00

前几天读了redis双链表的实现,一个标准的双链表,但是也实现了存储任意类型,用void*,真的是奇淫技巧,可能是我见识少,感觉也能实现内核链表那种感觉,今天看来记录一下。

首先是结构定义

c
/* Node, List, and Iterator are the only data structures used currently. */ typedef struct listNode { //指针和数据耦合在一起,非侵入式 struct listNode *prev; struct listNode *next; void *value; } listNode;
编辑
2023-11-16
发癫
00

上了大学之后就好久没碰日语了,最近打算重拾日语,毕竟学好了以后也是一门吃饭的活,码农码农,谁知道自己

编辑
2023-11-16
英语单词
00

What is Redis?

Redis is a fast in-memory NoSQL database and cache. Besides open-source, written in C, and designed for speed, Redis means “Remote Dictionary Server”.

Its fundamental data types are strings, lists, hashes, sets, and sorted sets; therefore Redis is often referred to as a data structure server. Many other data structures and capabilities for geolocation and stream processing are also available.

编辑
2023-11-15
redis
00

之前讲server启动的时候有个InitServerLast()函数

c
/* Some st