随笔分类 - go-redis
摘要:采用一致性hash算法将key分散到不同的节点,客户端可以连接到集群中任意一个节点 https://github.com/csgopher/go-redis 本文涉及以下文件: consistenthash:实现添加和选择节点方法 standalone_database:单机database cli
阅读全文
摘要:将用户发来的指令以RESP协议的形式存储在本地的AOF文件,重启Redis后执行此文件恢复数据 https://github.com/csgopher/go-redis 本文涉及以下文件: redis.conf:配置文件 aof:实现aof redis.conf appendonly yes app
阅读全文
摘要:实现Redis的database层(核心层:处理命令并返回) https://github.com/csgopher/go-redis 本文涉及以下文件: dict:定义字典的一些方法 sync_dict:实现dict db:分数据库 command:定义指令 ping,keys,string:指令
阅读全文
摘要:本文实现Redis的协议层,协议层负责解析指令,然后将指令交给核心database执行 echo database用来测试协议层的代码 https://github.com/csgopher/go-redis 本文涉及以下文件: conn:定义连接接口 interface/reply:定义各类响应接
阅读全文
摘要:本文实现一个Echo TCP Server 完整代码:https://github.com/csgopher/go-redis 本文涉及以下文件: handler:处理连接,客户端传来的指令 server:服务端 echo:测试 main interface/tcp/Handler.go type
阅读全文

浙公网安备 33010602011771号