Coder Social home page Coder Social logo

godis's Introduction

Build Status Go Report Card Go Reference GitHub go.mod Go version GitHub tag (latest by date) license

Go 语言实现分布式缓存服务器

Godis 是一个用 Go 语言实现的 Redis 服务器。支持分布式和集群模式

demo

项目特性

  • 支持 string, hash 数据结构
  • AOF 持久化
  • 加载和导出 AOF 文件
  • 内置集群模式
  • 支持分布式

项目结构

  • 根目录: main 函数,执行入口
  • config: 配置文件解析
  • interface: 一些模块间的接口定义
  • lib: 各种工具,比如logger、同步和通配符
  • tcp: tcp 服务器实现
  • resp: redis 协议解析器
  • datastruct: redis 的各类数据结构实现
    • dict: hash 表
  • database: 存储引擎核心
    • standalone_database.go: 单个 database 的数据结构和功能
    • command.go: 将命令路由给响应的处理函数
    • db.go: 处理命令的核心函数
    • keys.go: del、ttl、expire 等通用命令实现
    • string.go: get、set 等字符串命令实现
    • ping.go: ping 等字符串命令实现
  • cluster: 集群
    • client_pool.go: 集群入口
    • com.go: 节点间通信
    • del.go: delete 命令原子性实现
    • flush.go: flush 命令原子性实现
    • ping.go: ping 命令原子性实现
    • select.go: select 命令原子性实现
    • rename.go: rename 命令集群实现
  • aof: AOF 持久化实现

godis's People

Contributors

stream1080 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.